Language
C++
Compiler
gcc 9.1.0
Options
Warnings
Don't Use Boost
C++2a
-pedantic-errors
$ g++ prog.cc -Wall -Wextra -std=c++2a -pedantic-errors
Exit Code:
1
Author
anonymous
about 6 years ago
C++
gcc 9.1.0
Author
anonymous
about 6 years ago
$ g++ prog.cc -Wall -Wextra -std=c++2a -pedantic-errors
prog.cc: In function 'int main()':
prog.cc:7:11: error: call of overloaded 'k<0>(int)' is ambiguous
7 | k<0>(0);
| ^
prog.cc:1:30: note: candidate: 'void k(decltype (<lambda>())) [with int N = 0; decltype (<lambda>()) = int]'
1 | template <int N> static void k(decltype([]{ return 0; }()));
| ^
prog.cc:2:30: note: candidate: 'void k(decltype (<lambda>())) [with int N = 0; decltype (<lambda>()) = int]'
2 | template <int N> static void k(decltype([]{ return 0; }()));
| ^
prog.cc:3:30: note: candidate: 'void k(int) [with int N = 0]'
3 | template <int N> static void k(int) {}
| ^