This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6289: partial template specialization and friend
- From: Nathan Sidwell <nathan at acm dot org>
- To: Reichelt <reichelt at igpm dot rwth-aachen dot de>
- Cc: gcc-gnats at gcc dot gnu dot org, jototland at hotmail dot com, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, bangerth at math dot ethz dot ch
- Date: Wed, 08 May 2002 12:34:04 +0100
- Subject: Re: c++/6289: partial template specialization and friend
- References: <200205081052.MAA04735@numa6.igpm.rwth-aachen.de>
- Reply-to: nathan at compsci dot bristol dot ac dot uk
Reichelt wrote:
>
> Hi,
>
> here's an even shorter example:
>
> ---------------------------snip here--------------------------
> template <typename T> class B
> {
> typedef int X;
> friend class X;
> };
> ---------------------------snip here--------------------------
>
> This is in fact legal code (and is accepted by SGI's and Comeau's
> compiler for example). It would be illegal, if the friend declaration
no it is ill formed. [7.1.5.3]/2 says
if the identifier resolves to a typedef name, or a template
type-parameter, the elaborated type specifier is ill-formed.
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
The voices in my head told me to say this
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk