From mboxrd@z Thu Jan 1 00:00:00 1970 From: rodrigc@gcc.gnu.org To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c++/71 Date: Mon, 28 May 2001 19:56:00 -0000 Message-id: <20010529025603.9891.qmail@sourceware.cygnus.com> X-SW-Source: 2001-05/msg00989.html List-Id: 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 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