template <class> struct Z {};struct B : Z<int> {};struct C : B, Z<int> {};void f(Z<int> const &) {}int main() { f(C()); }
Standard input is empty
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()); } ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!