Author
anonymous
almost 8 years ago
Language
C++
Compiler
gcc HEAD 7.0.1 20170327 (experimental)
Options
Warnings
Boost 1.63.0
C++1z(GNU)
no pedantic
Author
anonymous
almost 8 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.63.0/gcc-head/include -std=gnu++1z
prog.cc: In function 'int main()':
prog.cc:23:12: error: call of '(ob0) (int)' is ambiguous
ob0{}(0); // Ambiguous because `a0::operator()(int)` appears multiple times in the base classes.
^
prog.cc:2:18: note: candidate: void a0<<anonymous> >::operator()(int) [with int <anonymous> = 0]
struct a0 { void operator()(int){} };
^~~~~~~~
prog.cc:5:18: note: candidate: void a1<<anonymous> >::operator()(char) [with int <anonymous> = 0]
struct a1 { void operator()(char){} };
^~~~~~~~
prog.cc:2:18: note: candidate: void a0<<anonymous> >::operator()(int) [with int <anonymous> = 1]
struct a0 { void operator()(int){} };
^~~~~~~~
prog.cc:38:14: error: call of '(ob1) (char)' is ambiguous
ob1{}('a'); // Ambiguous because `a1::operator()(char)` appears multiple times in the base classes.
^
prog.cc:2:18: note: candidate: void a0<<anonymous> >::operator()(int) [with int <anonymous> = 0]
struct a0 { void operator()(int){} };
^~~~~~~~
prog.cc:5:18: note: candidate: void a1<<anonymous> >::operator()(char) [with int <anonymous> = 0]
struct a1 { void operator()(char){} };
^~~~~~~~
prog.cc:5:18: note: candidate: void a1<<anonymous> >::operator()(char) [with int <anonymous> = 1]
Exit Code:
1