fork download
  1. template <class> struct Z {};
  2. struct B : Z<int> {};
  3. struct C : B, Z<int> {};
  4. void f(Z<int> const &) {}
  5. int main() { f(C()); }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:3:8: warning: direct base ‘Z<int>’ inaccessible in ‘C’ due to ambiguity [enabled by default]
 struct C : B, Z<int> {};
        ^
prog.cpp: In function ‘int main()’:
prog.cpp:5:19: error: ‘Z<int>’ is an ambiguous base of ‘C’
 int main() { f(C()); }
                   ^
stdout
Standard output is empty