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

reference to basic_ostream is ambiguous when using libc++ and #include <iostream> first #2

Open
FeignClaims opened this issue May 13, 2024 · 0 comments

Comments

@FeignClaims
Copy link

FeignClaims commented May 13, 2024

This library fails to compile with libc++ when #include <iostream> in front of #include <ut2>.

godbolt

/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:169:8: error: reference to 'basic_ostream' is ambiguous
  169 | extern basic_ostream<char, char_traits<char>> clog; // only used if defined
      |        ^
/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:168:30: note: candidate found by name lookup is 'std::basic_ostream'
  168 | template<class, class> class basic_ostream;
      |                              ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/ostream:208:28: note: candidate found by name lookup is 'std::__1::basic_ostream'
  208 | class _LIBCPP_TEMPLATE_VIS basic_ostream : virtual public basic_ios<_CharT, _Traits> {
      |                            ^
In file included from /Users/feignclaims/code/cpp/cpp-practice/test/main.cpp:2:
/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:169:28: error: reference to 'char_traits' is ambiguous
  169 | extern basic_ostream<char, char_traits<char>> clog; // only used if defined
      |                            ^
/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:167:24: note: candidate found by name lookup is 'std::char_traits'
  167 | template<class> struct char_traits;
      |                        ^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/__string/char_traits.h:83:92: note: candidate found by name lookup is 'std::__1::char_traits'
   83 |     "for a temporary period. It will be removed in LLVM 19, so please migrate off of it.") char_traits {
      |                                                                                            ^
In file included from /Users/feignclaims/code/cpp/cpp-practice/test/main.cpp:2:
/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:180:39: error: reference to 'clog' is ambiguous
  180 |         static_assert(requires { std::clog << t; }, "[ERROR] No output supported: Consider #include <iostream> | ut::cfg<ut::override> = custom_cfg{} | #define UT_COMPILE_TIME_ONLY");
      |                                  ~~~~~^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/iostream:57:42: note: candidate found by name lookup is 'std::__1::clog'
   57 | extern _LIBCPP_EXPORTED_FROM_ABI ostream clog;
      |                                          ^
/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:169:47: note: candidate found by name lookup is 'std::clog'
  169 | extern basic_ostream<char, char_traits<char>> clog; // only used if defined
      |                                               ^
/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:181:22: error: reference to 'clog' is ambiguous
  181 |         return (std::clog << t);
      |                 ~~~~~^
/opt/homebrew/opt/llvm/bin/../include/c++/v1/iostream:57:42: note: candidate found by name lookup is 'std::__1::clog'
   57 | extern _LIBCPP_EXPORTED_FROM_ABI ostream clog;
      |                                          ^
/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:169:47: note: candidate found by name lookup is 'std::clog'
  169 | extern basic_ostream<char, char_traits<char>> clog; // only used if defined
      |                                               ^
/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:181:22: error: unknown type name 'clog'
  181 |         return (std::clog << t);
      |                      ^
/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:181:27: error: expected ')'
  181 |         return (std::clog << t);
      |                           ^
/Users/feignclaims/.conan2/p/b/boost44f8b84116680/p/include/ut2:181:16: note: to match this '('
  181 |         return (std::clog << t);
      |                ^
6 errors generated.
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

1 participant