This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6289: partial template specialization and friend
- From: Reichelt <reichelt at igpm dot rwth-aachen dot de>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 8 May 2002 10:26:02 -0000
- Subject: Re: c++/6289: partial template specialization and friend
- Reply-to: Reichelt <reichelt at igpm dot rwth-aachen dot de>
The following reply was made to PR c++/6289; it has been noted by GNATS.
From: Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, jototland@hotmail.com, gcc-bugs@gcc.gnu.org,
nobody@gcc.gnu.org, bangerth@math.ethz.ch
Cc:
Subject: Re: c++/6289: partial template specialization and friend
Date: Wed, 8 May 2002 12:52:10 +0200
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
read "friend class B<T>::X", but this way "friend class X" refers to a
class outside of B (which hasn't been defined yet). If you add
"class X;" before the definiton of B then the ICE vanishes.
Greetings,
Volker Reichelt
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6289