fork download
  1. #include <memory>
  2.  
  3. struct Listener {};
  4. struct TCP : public Listener {};
  5. struct Domain : public Listener {};
  6. struct A {};
  7. struct Branch : public TCP, public A {};
  8. struct DIAMOND : public TCP, public Domain {};
  9.  
  10. int main() {
  11. std::unique_ptr<Listener> ptr;
  12. ptr.reset(new TCP);
  13. ptr.reset(new Domain);
  14. ptr.reset(new Branch);
  15. ptr.reset(new DIAMOND);
  16. }
  17.  
Compilation error #stdin compilation error #stdout 0s 3268KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:15:30: error: 'Listener' is an ambiguous base of 'DIAMOND'
         ptr.reset(new DIAMOND);
                              ^
stdout
Standard output is empty