This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/2421: can't declare ordinary nested class as friend of template class
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/2421: can't declare ordinary nested class as friend of template class
- From: jhl at sssonline dot com
- Date: 29 Mar 2001 01:49:31 -0000
- Cc: mjm at sssonline dot com
- Reply-To: jhl at sssonline dot com
>Number: 2421
>Category: c++
>Synopsis: can't declare ordinary nested class as friend of template class
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Wed Mar 28 17:56:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Jonathan H Lundquist
>Release: 2.95.2
>Organization:
>Environment:
Debian 2.2 i386
>Description:
The following is an example of the problem, as described in the synopsis:
class A {
public:
class X;
};
template<typename T>
class B {
friend class A::X;
public:
B() {}
};
int main()
{
B<int> b;
return 0;
}
causes 'A::X' does not declare a template type
>How-To-Repeat:
Compile example in description
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="friend.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="friend.cpp"
Y2xhc3MgQSB7CnB1YmxpYzoKICAgY2xhc3MgWDsKfTsKCnRlbXBsYXRlPHR5cGVuYW1lIFQ+CmNs
YXNzIEIgewogICBmcmllbmQgY2xhc3MgQTo6WDsKcHVibGljOgogICBCKCkge30KfTsKCmludCBt
YWluKCkKewogICBCPGludD4gYjsKICAgcmV0dXJuIDA7Cn0KCg==