g++ 2.95.2 disallows partially specialized friends

Martin Sebor sebor@roguewave.com
Wed Mar 22 14:06:00 GMT 2000


Martin,

in case you're not subscribed, attached is my discussion with John Spicer on the
reflector. I hope this clarifies things.

Regards
Martin


Subject : Re: declaring a partial specialization a friend
>From : "John H. Spicer" <jhs at edg dot com>
Date : Wed, 22 Mar 2000 16:56:28 -0500
Organization : Edison Design Group
References : <38D9222C.9469AC32@roguewave.com> <38D92499.51BE3703@edg.com> <38D92B08.54D0B1A8@roguewave.com> <38D93018.336FAE42@edg.com> <38D93F71.C1533831@roguewave.com>
Reply-To : c++std-core at research dot att dot com
Transport-Options : /ignore

To: C++ core language mailing list
Message c++std-core-8613

Martin Sebor wrote:

> > If this were not enough, there is also the wording in 14.5.3p4 that says
> > "A template friend declaration specifies that all specializations of that template,
> > whether they are implicitly instantiated, partially specialized, or explicitly
> > specialized are friend of the class containing the friend declaration.".
> >
> > This directly contradicts the interpretation that you mention.
> 
> I don't think that p4 applies to the friend declaration in my example since the
> paragraph talks about template friend declarations. But even if it did, I fail
> to see the contradiction. All the paragraph says is that a template friend
> declaration makes every specialization generated from that template a friend. It
> doesn't say that the friend declaration itself can limit the scope of
> specializations to which it grants friendship by referring to a partial
> specialization.
> 

It explicitly says that a partial specialization can be a friend, which
contradicts the asserted meaning of the text in question.

John Spicer
Edison Design Group


More information about the Gcc-bugs mailing list