https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68948
Patrick Palka <ppalka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ppalka at gcc dot gnu.org --- Comment #9 from Patrick Palka <ppalka at gcc dot gnu.org> --- (In reply to Timo Reimann from comment #8) > Author of the original failing code here. I'm not too deep into the standard > to be able to make a judgement on whether this should be legal code or not. > (FWIW though, it compiles fine in Clang.) If the extra namespace qualifier > leads to method calls getting dropped silently, however, gcc should emit a > compile error from my perspective. This would also be consistent with > non-template code variations of the problem at hand. > > Section 3.4.3.1 of the standard says: In a lookup in which function names are not ignored and the nested-name-specifier nominates a class C: — if the name specified after the nested-name-specifier, when looked up in C, is the injected-class-name of C (Clause 9), the name is instead considered to name the constructor of class C. Such a constructor name shall be used only in the declarator-id of a declaration that names a constructor or in a using-declaration. I think the last line in particular means that the code is not legal.