Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 19 hours ago

Language

C++

Compiler

gcc HEAD 16.0.0 20250704 (experimental)

Options
Warnings
Don't Use Boost
C++2b(GNU)
no pedantic
Raw compiler options
-DDECLARATION=117

Author

anonymous

about 19 hours ago

$ g++ prog.cc -Wall -Wextra -std=gnu++2b -DDECLARATION=117
prog.cc:18:65: error: 'std::ostream& operator<<(std::ostream&, std::u8string_view)' conflicts with a previous declaration
   18 | std::ostream& operator<<(std::ostream& os, std::u8string_view sv)
      |                                                                 ^
prog.cc:6:15: note: previous declaration 'std::ostream& debug::operator<<(std::ostream&, std::u8string_view)'
    6 | std::ostream& operator<<(std::ostream& os, std::u8string_view sv)
      |               ^~~~~~~~
prog.cc: In function 'int main()':
prog.cc:29:13: error: ambiguous overload for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::u8string_view' {aka 'std::basic_string_view<char8_t>'})
   29 |   std::cout << sv << std::endl;
      |   ~~~~~~~~~ ^~ ~~
      |        |       |
      |        |       std::u8string_view {aka std::basic_string_view<char8_t>}
      |        std::ostream {aka std::basic_ostream<char>}
prog.cc:29:13: note: there are 54 candidates
   29 |   std::cout << sv << std::endl;
      |   ~~~~~~~~~~^~~~~
prog.cc:6:15: note: candidate 1: 'std::ostream& debug::operator<<(std::ostream&, std::u8string_view)'
    6 | std::ostream& operator<<(std::ostream& os, std::u8string_view sv)
      |               ^~~~~~~~
prog.cc:18:15: note: candidate 2: 'std::ostream& operator<<(std::ostream&, std::u8string_view)'
   18 | std::ostream& operator<<(std::ostream& os, std::u8string_view sv)
      |               ^~~~~~~~
Exit Code:
1