https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84030
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2018-01-26 CC| |msebor at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- Confirmed. All versions of GCC all the way to 4.1 accept the code so it's not a recent regression. EDG eccp 4.13 prints the following warning: "pr84030.C", line 20: warning: ambiguous class member reference -- type "N_::A_::A_" (declared at line 5) used in preference to class "A_" (declared at line 3) int b = a.operator A_().g(); ^ I don't know if the standard requires an error for the ambiguity but if not, it would seem appropriate to at least issue a warning.