Testcase: struct B1 { void f(); }; struct B2 { void f(double); }; struct I1 : B1 { }; struct I2 : B1 { }; struct D: I1, I2, B2 { void g() { f(); } }; gcc-4.6: clang-8.C:9:5: error: reference to ‘f’ is ambiguous clang-8.C:2:18: error: candidates are: void B2::f(double) clang-8.C:1:18: error: void B1::f() clang-8.C:1:18: error: void B1::f() B1 is printed twice and there is no clear info about the hierarchy. clang: t.cc:10:5: error: non-static member 'f' found in multiple base-class subobjects of type 'B1': struct D -> struct I1 -> struct B1 struct D -> struct I2 -> struct B1 f(); ^ t.cc:1:18: note: member found by ambiguous name lookup struct B1 { void f(); }; ^
Jason, do we want this? Following Clang or in some other way?
(In reply to Manuel López-Ibáñez from comment #1) > Jason, do we want this? > > Following Clang or in some other way? Yes, the Clang diagnostic is better. There are two issues with the G++ diagnostic: 1) It talks about f(double), which is not viable. 2) It doesn't distinguish between two occurrences of the same function reached through different base paths.