Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 4 years ago

Language

C++

Compiler

gcc HEAD 12.0.0 20210721 (experimental)

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

Author

anonymous

almost 4 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2b
prog.cc: In function 'int main()':
prog.cc:20:13: error: class template argument deduction failed:
   20 |   A a{&i, &d};
      |             ^
prog.cc:20:13: error: no matching function for call to 'C(int*, double*)'
prog.cc:10:1: note: candidate: 'template<class V> C(V*, V*)-> C<V*, V*>'
   10 | C(T, U) -> C<T, U>;
      | ^
prog.cc:10:1: note:   template argument deduction/substitution failed:
prog.cc:20:13: note:   deduced conflicting types for parameter 'V' ('int' and 'double')
   20 |   A a{&i, &d};
      |             ^
prog.cc:4:8: note: candidate: 'template<class V> C(C<V*, V*>)-> C<V*, V*>'
    4 | struct C {
      |        ^
prog.cc:4:8: note:   template argument deduction/substitution failed:
prog.cc:20:13: note:   mismatched types 'C<V*, V*>' and 'int*'
   20 |   A a{&i, &d};
      |             ^
prog.cc:5:3: note: candidate: 'template<class V> C(V*, V*)-> C<V*, V*>'
    5 |   C(T, U);
      |   ^
prog.cc:5:3: note:   template argument deduction/substitution failed:
prog.cc:20:13: note:   deduced conflicting types for parameter 'V' ('int' and 'double')
   20 |   A a{&i, &d};
      |             ^
Exit Code:
1