Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: reference to ‘char_traits’ is ambiguous #1117

Closed
375gnu opened this issue Apr 16, 2019 · 1 comment
Closed

error: reference to ‘char_traits’ is ambiguous #1117

375gnu opened this issue Apr 16, 2019 · 1 comment

Comments

@375gnu
Copy link

375gnu commented Apr 16, 2019

Hello!

This simple program doesn't complie with the current master (397e8dd):

#include <fmt/printf.h>
#include <string>
using namespace std;
int main()
{
char_traits<char>::char_type c;
return 0;

The output is

test.cc: In function ‘int main()’:
test.cc:8:1: error: reference to ‘char_traits’ is ambiguous
 char_traits<char>::char_type c;
 ^~~~~~~~~~~
In file included from /usr/include/c++/8/algorithm:61,
                 from include/fmt/printf.h:11,
                 from test.cc:1:
/usr/include/c++/8/bits/stl_algobase.h:392:12: note: candidates are: ‘template<class _CharT> struct std::char_traits’
     struct char_traits;
            ^~~~~~~~~~~
In file included from include/fmt/ostream.h:12,
                 from include/fmt/printf.h:14,
                 from test.cc:1:
include/fmt/format.h:555:33: note:                 ‘template<class Char> struct fmt::v5::internal::char_traits’
 template <typename Char> struct char_traits;
                                 ^~~~~~~~~~~
test.cc:6:13: error: expected primary-expression before ‘char’
 char_traits<char>::char_type c;

My compiler is:

g++ --version
g++ (Debian 8.3.0-2) 8.3.0

The same with clang+++ 7.

@vitaut
Copy link
Contributor

vitaut commented Apr 17, 2019

Fixed in dc94010. Thanks for reporting!

@vitaut vitaut closed this as completed Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants