Author
anonymous
about 7 years ago
Language
C++
Compiler
gcc HEAD 8.0.1 20180126 (experimental)
Options
Warnings
Boost 1.66.0
C++2a(GNU)
no pedantic
Author
anonymous
about 7 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.66.0/gcc-head/include -std=gnu++2a
prog.cc: In function 'int main()':
prog.cc:8:19: error: no match for call to '(main()::<lambda(auto:1)>) (tag<int>)'
foo(tag<int>{});
^
prog.cc:5:30: note: candidate: 'template<class auto:1> constexpr main()::<lambda(auto:1)>::operator decltype (bar(x)) (*)(auto:1)() const'
auto foo = [](auto x) -> decltype(bar(x)) { return {}; };
^~~~~~~~
prog.cc:5:30: note: template argument deduction/substitution failed:
prog.cc: In substitution of 'template<class auto:1> constexpr main()::<lambda(auto:1)>::operator decltype (bar(x)) (*)(auto:1)() const [with auto:1 = tag<int>]':
prog.cc:8:19: required from here
prog.cc:5:42: error: 'bar' was not declared in this scope
auto foo = [](auto x) -> decltype(bar(x)) { return {}; };
~~~^~~
prog.cc:5:30: note: candidate: 'template<class auto:1> main()::<lambda(auto:1)>'
auto foo = [](auto x) -> decltype(bar(x)) { return {}; };
^~~~~~~~
prog.cc:5:30: note: template argument deduction/substitution failed:
prog.cc: In substitution of 'template<class auto:1> main()::<lambda(auto:1)> [with auto:1 = tag<int>]':
prog.cc:8:19: required from here
prog.cc:5:42: error: 'bar' was not declared in this scope
auto foo = [](auto x) -> decltype(bar(x)) { return {}; };
~~~^~~
Exit Code:
1