This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21971] New: class friend declaration doesn't allow use in class scope
- From: "jconner at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jun 2005 00:16:09 -0000
- Subject: [Bug c++/21971] New: class friend declaration doesn't allow use in class scope
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code:
class a {
friend class b;
b *pb;
};
Produces an error message in the current mainline (4.1.0 development):
bar.c:3: error: ISO C++ forbids declaration of 'b' with no type
bar.c:3: error: expected ';' before '*' token
14882:2003, 11.4.7, indicates that this should be allowed:
"A name nominated by a friend declaration shall be accessible in the scope of the class containing the
friend declaration."
This is a regression from 4.0.
--
Summary: class friend declaration doesn't allow use in class
scope
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jconner at apple dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21971