[Bug c++/18681] template friend declaration not recognized
-- What|Removed |Added AssignedTo|unassigned at gcc dot gnu |lerdsuwa at gcc dot gnu dot |dot org |org Status|REOPENED|ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18681
[Bug c++/18681] template friend declaration not recognized
--- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-11-29 14:00 --- OK, sorry for the mistake. I'll look at it again. -- What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18681
[Bug c++/18681] template friend declaration not recognized
--- Additional Comments From giovannibajo at libero dot it 2004-11-29 11:34 --- adding Kriang to CC so that he does not miss the comment. -- What|Removed |Added CC||lerdsuwa at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18681
[Bug c++/18681] template friend declaration not recognized
--- Additional Comments From wolfgang dot roehrl at de dot gi-de dot com 2004-11-29 07:12 --- Subject: Antwort: template friend declaration not recognized Hi all, I'm responding to the "Comments From lerdsuwa at gcc dot gnu dot org 2004-11-27 16:19": I do not think that the cited standard rule (11.4/2) matches my example because the nested class C1::S1 uses a name of its surrounding class - namely C1::T_PAR. For the definition of this name class C1 in turn is referring to a name of class C2 - namely C2::T_PAR_TYPE. And class C2 grants class C1 access to its private names. Best regards, W. Roehrl -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18681
[Bug c++/18681] template friend declaration not recognized
--- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-11-27 16:19 --- Not a bug. You are using TPAR inside the class C1::S, however, only C1 is a friend of C2. This is the relevent section of C++ standard (section 11.4 paragraph 2): ... the declarations of members of classes nested within the friend class cannot access the names of private and protected members from the class granting friendship. ... and the example in the same section: class A { class B {}; friend class X; }; class X : A::B { // ill-formed: A::B cannot be accessed // in the base-clause for X A::B mx; // OK: A::B used to declare member of X class Y : A::B { // OK: A::B used to declare member of X A::B my; // ill-formed: A::B cannot be accessed // to declare members of nested class of X }; }; -- What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID Summary|[3.3/3.4/4.0 regression]|template friend declaration |template friend declaration |not recognized |not recognized | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18681
[Bug c++/18681] template friend declaration not recognized
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-26 15:33 --- *** This bug has been marked as a duplicate of 950 *** -- What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18681