Language
C++
Compiler
gcc HEAD 8.0.0 20171215 (experimental)
Options
Warnings
Boost 1.65.1
C++2a(GNU)
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.65.1/gcc-head/include -std=gnu++2a
Exit Code:
1
Author
anonymous
about 7 years ago
C++
gcc HEAD 8.0.0 20171215 (experimental)
Author
anonymous
about 7 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.65.1/gcc-head/include -std=gnu++2a
prog.cc: In function 'int main()':
prog.cc:27:21: error: no match for 'operator*' (operand types are 'bar<int>' and 'int')
std::cout << (y * 3).n << std::endl;
~~^~~
prog.cc:14:5: note: candidate: 'foo operator*(foo, foo)'
foo operator * (foo u, foo v) {
^~~~~~~~
prog.cc:14:5: note: no known conversion for argument 1 from 'bar<int>' to 'foo'
prog.cc:19:8: note: candidate: 'template<class T> bar<T> operator*(bar<T>, bar<T>)'
bar<T> operator * (bar<T> u, bar<T> v) {
^~~~~~~~
prog.cc:19:8: note: template argument deduction/substitution failed:
prog.cc:27:23: note: mismatched types 'bar<T>' and 'int'
std::cout << (y * 3).n << std::endl;
^