[Bug c++/18681] template friend declaration not recognized
lerdsuwa at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat Nov 27 16:20:00 GMT 2004
------- 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<T>::S,
however, only C1<T> 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
More information about the Gcc-bugs
mailing list