#include <iostream>using namespace std; struct Base1{ void Foo(double param) { cout << "Base1::Foo(double)" << endl; }}; struct Base2{ void Foo(int param) { cout << "Base2::Foo(int)" << endl; }}; struct Derived : public Base1, public Base2{}; int main(int argc, char **argv){ Derived d; d.Foo(1.2); return 1;}
Standard input is empty
prog.cpp: In function ‘int main(int, char**)’: prog.cpp:27:7: error: request for member ‘Foo’ is ambiguous prog.cpp:14:10: error: candidates are: void Base2::Foo(int) prog.cpp:6:10: error: void Base1::Foo(double)
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!