Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 5 years ago

Language

C++

Compiler

gcc HEAD 10.0.1 20200309 (experimental)

Options
Warnings
Boost 1.72.0
C++2a(GNU)
no pedantic

Author

anonymous

over 5 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.72.0/gcc-head/include -std=gnu++2a
prog.cc: In function 'int main()':
prog.cc:19:45: error: no matching function for call to 'bar(<unresolved overloaded function type>, int&)'
   19 |     std::cout << bar(foo<decltype(arg)>, arg) << std::endl;
      |                                             ^
prog.cc:10:16: note: candidate: 'template<class Fn, class T> decltype(auto) bar(Fn, T)'
   10 | decltype(auto) bar(Fn fn, T t)
      |                ^~~
prog.cc:10:16: note:   template argument deduction/substitution failed:
prog.cc:19:45: note:   couldn't deduce template parameter 'Fn'
   19 |     std::cout << bar(foo<decltype(arg)>, arg) << std::endl;
      |                                             ^
Exit Code:
1