This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/43117] Accepts invalid typedef
- From: "jason at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Feb 2010 01:38:56 -0000
- Subject: [Bug c++/43117] Accepts invalid typedef
- References: <bug-43117-102@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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