Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Language

C++

Compiler

gcc HEAD 11.0.0 20200712 (experimental)

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

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2a
prog.cc: In function 'int main()':
prog.cc:23:14: error: class template argument deduction failed:
   23 |     Bar f{ 5 };
      |              ^
prog.cc:23:14: error: no matching function for call to 'Foo(int)'
prog.cc:14:1: note: candidate: 'template<class T, class F> Foo(F&&)-> Foo<1, typename alias2<F>::type> requires  __is_same(Bar<T>, Foo<1, typename alias2<F>::type>)'
   14 | Foo(F&& f) -> Foo<Q, typename alias2<F>::type>;
      | ^~~
prog.cc:14:1: note:   template argument deduction/substitution failed:
prog.cc:23:14: note:   couldn't deduce template parameter 'T'
   23 |     Bar f{ 5 };
      |              ^
prog.cc:2:8: note: candidate: 'template<class T> Foo(Foo<1, T>)-> Foo<1, T>'
    2 | struct Foo {
      |        ^~~
prog.cc:2:8: note:   template argument deduction/substitution failed:
prog.cc:23:14: note:   mismatched types 'Foo<1, T>' and 'int'
   23 |     Bar f{ 5 };
      |              ^
prog.cc:4:5: note: candidate: 'template<class T, class F> Foo(F&&)-> Foo<1, T>'
    4 |     Foo(F&&) { }
      |     ^~~
prog.cc:4:5: note:   template argument deduction/substitution failed:
prog.cc:23:14: note:   couldn't deduce template parameter 'T'
   23 |     Bar f{ 5 };
      |              ^
Exit Code:
1