public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/71
@ 2001-05-28 19:56 rodrigc
0 siblings, 0 replies; only message in thread
From: rodrigc @ 2001-05-28 19:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/71; it has been noted by GNATS.
From: rodrigc@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, jmaurer@menuett.rhein-main.de, rodrigc@gcc.gnu.org,
martin@loewis.home.cs.tu-berlin.de, nobody@gcc.gnu.org
Cc:
Subject: Re: c++/71
Date: 29 May 2001 02:47:33 -0000
Synopsis: C++ typedef redefinitions and templates
State-Changed-From-To: analyzed->closed
State-Changed-By: rodrigc
State-Changed-When: Mon May 28 19:47:32 2001
State-Changed-Why:
The C++ Standard, section 7.1.3, paragraph 2 states
that:
"In a given scope, a typedef specifier can be used
to redefine the name of any type
declared in that scope to refer
to the type to which it already refers:
typedef int I;
typedef int I;
In your example
template<class T>
struct A {
typedef int X;
typedef T X;
};
Although T may expand to an int when the template is
instantiated, in the scope of the template itself, the
two typedefs are assigning different types to X.
The same error message is generated when compiling with
gcc 3.0
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=71&database=gcc
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-05-28 19:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-28 19:56 c++/71 rodrigc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).