Language
C++
Compiler
gcc 8.2.0
Options
Warnings
Boost 1.68.0
C++11
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/gcc-8.2.0/include -std=c++11
Exit Code:
1
Author
anonymous
over 6 years ago
C++
gcc 8.2.0
Author
anonymous
over 6 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/gcc-8.2.0/include -std=c++11
prog.cc:21:7: warning: direct base 'A' inaccessible in 'D' due to ambiguity
class D : public B, public A {
^
prog.cc: In function 'int main()':
prog.cc:28:33: error: 'A' is an ambiguous base of 'D'
if (A* pa = dynamic_cast<A*>(pd)) {
^
prog.cc:28:33: error: 'A' is an ambiguous base of 'D'
prog.cc:28:9: warning: unused variable 'pa' [-Wunused-variable]
if (A* pa = dynamic_cast<A*>(pd)) {
^~