Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 3 years ago

Language

C++

Compiler

gcc 11.1.0

Options
Warnings
Don't Use Boost
C++2b
no pedantic

Author

anonymous

over 3 years ago

$ g++ prog.cc -Wall -Wextra -std=c++2b
prog.cc:24:21: error: call of overloaded 'f<42>()' is ambiguous
   24 | static_assert( f<42>() == 2 );
      |                ~~~~~^~
prog.cc:17:15: note: candidate: 'constexpr int f() [with auto N = 42]'
   17 | constexpr int f() { return 1; }
      |               ^
prog.cc:21:15: note: candidate: 'constexpr int f() [with auto N = 42]'
   21 | constexpr int f() { return 2; }
      |               ^
Exit Code:
1