Why can't GCC disambiguate multiple inherited functions (yet clang can)? [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Why do multiple-inherited functions with same name but different signatures not get treated as overloaded functions? This fails to compile in the indicated place with g++ 4.6.1: enum Ea { Ea0 }; enum Eb { Eb0 }; struct Sa { void operator()(Ea) {} }; struct Sb { void operator()(Eb) {} }; struct Sbroken : Sa, Sb {}; struct Sworks { void operator()(Ea) {} void operator()(Eb) {} }; int main() { Sworks()(Ea0);