This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/6289: partial template specialization and friend


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
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]