Language
C++
Compiler
gcc HEAD 9.0.1 20190313 (experimental)
Options
Warnings
Boost 1.69.0
C++2a(GNU)
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.69.0/gcc-head/include -std=gnu++2a
Exit Code:
1
Author
anonymous
over 6 years ago
C++
gcc HEAD 9.0.1 20190313 (experimental)
Author
anonymous
over 6 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.69.0/gcc-head/include -std=gnu++2a
prog.cc:14:19: error: call to non-'constexpr' function 'int g(int)'
14 | auto f(T t) -> U<g(T()) + h(T())> {}
| ~^~~~~
prog.cc: In function 'int main()':
prog.cc:19:7: warning: unused variable 'k' [-Wunused-variable]
19 | int k = f(0);
| ^
prog.cc: In instantiation of 'constexpr int h(T) [with T = int]':
prog.cc:14:28: required by substitution of 'template<class T> U<(g(T()) + h(T()))> f(T) [with T = int]'
prog.cc:19:14: required from here
prog.cc:11:32: error: 'error' is not a member of 'int'
11 | constexpr int h(T) { return T::error; }
| ^~~~~