Language
C++
Compiler
gcc 9.2.0
Options
Warnings
Boost 1.72.0
C++2a(GNU)
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.72.0/gcc-9.2.0/include -std=gnu++2a A::A()
B::B()
A::A()
A::A()
B::B()
A::A()
C::C()
D::D()
Exit Code:
0
Author
anonymous
about 6 years ago
C++
gcc 9.2.0
Author
anonymous
about 6 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.72.0/gcc-9.2.0/include -std=gnu++2a prog.cc:34:8: warning: direct base 'A' inaccessible in 'C' due to ambiguity
34 | struct C : public B, public A {
| ^
prog.cc:40:8: warning: direct base 'B' inaccessible in 'D' due to ambiguity
40 | struct D: public B, public A, public C {
| ^
prog.cc:40:8: warning: direct base 'A' inaccessible in 'D' due to ambiguity
A::A()
B::B()
A::A()
A::A()
B::B()
A::A()
C::C()
D::D()