[Bug c++/43117] Accepts invalid typedef

jason at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Feb 19 01:39:00 GMT 2010



------- Comment #4 from jason at gcc dot gnu dot org  2010-02-19 01:38 -------
This doesn't seem specific to templates.  The non-template version

struct B { typedef int type; };
struct D : B {
  typedef type type;
};

D cc;
D::type tcc;

deals with the same issue, and is similarly accepted by G++ and EDG 4.1.

However, both seem to fall afoul of 3.3.7p1:

"A name N used in a class S shall refer to the same declaration in its context
and when re-evaluated in the completed scope of S. No diagnostic is required
for a violation of this rule."

So, G++ is within its rights not to complain.  And really, this use seems like
it ought to be valid anyway, since we don't have "inherited::".  So, closing
WONTFIX.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43117



More information about the Gcc-bugs mailing list