Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 7 years ago

Language

C++

Compiler

gcc 8.2.0

Options
Warnings
Boost 1.68.0
C++11
no pedantic

Author

anonymous

almost 7 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)) {
         ^~
Exit Code:
1