From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21273 invoked by alias); 14 Dec 2001 08:16:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21250 invoked by uid 71); 14 Dec 2001 08:16:02 -0000 Date: Fri, 14 Dec 2001 00:16:00 -0000 Message-ID: <20011214081602.21241.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Pal Benko Subject: Re: c++/5094: partial specialisation cannot be friend?? Reply-To: Pal Benko X-SW-Source: 2001-12/txt/msg00813.txt.bz2 List-Id: The following reply was made to PR c++/5094; it has been noted by GNATS. From: Pal Benko To: rodrigc@gcc.gnu.org Cc: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org Subject: Re: c++/5094: partial specialisation cannot be friend?? Date: Fri, 14 Dec 2001 09:08:51 +0100 Thank you for the quick answer. > This is not a bug in gcc. > This is not legal code. When I compile with > the Digital Unix C++ compiler, I get the > following compilation errors: > > cxx: Error: specfriend.cc, line 67: "c" has already been declared in = the > current scope > friend class c; > -----------------^ Is template <> struct c { class inner { friend class c; }; template friend class d >; }; correct? gcc accepts it, but it also accepted the previous version. > cxx: Error: specfriend.cc, line 71: class "c" may not have a template > argument list > friend class d >; > -----------------^ > cxx: Error: specfriend.cc, line 71: class "c" may not have a template > argument list > friend class d >; > -----------------^ > cxx: Error: specfriend.cc, line 71: invalid partial specialization -- > class > "d<>" is already fully specialized > friend class d >; > ---------------^ OK, Martin Sebor gave the exact reference from the standard. > cxx: Error: specfriend.cc, line 83: class "c" may not have a template > argument list > friend class c; > ---------------^ again: is template <> struct d { template class inner { friend class d; }; friend class c >; }; correct? gcc accepts, as previously. And there are three error messages of gcc not reproduced by the Digital Unix C++ in lines 42, 55 and 59 of the original bugreport. A simplified testcase: struct b { template class inner {}; }; template struct c {}; template struct c { class inner { friend class c; }; }; template struct c > { template class inner { friend class c; }; template friend class b::inner; }; Thanks again, Benko Pal=