This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47210] New: Compile error on type speciïer in a friend declaration designates a class type
- From: "boostcpp at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 7 Jan 2011 12:35:40 +0000
- Subject: [Bug c++/47210] New: Compile error on type speciïer in a friend declaration designates a class type
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47210
Summary: Compile error on type speciïer in a friend declaration
designates a class type
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: boostcpp@gmail.com
The restriction,
"An elaborated-type-specifier shall be used in a friend declaration for a
class."
, does not exists in the current C++0x draft.
In the latest draft(N2335),
11.4 Friends [class.friend] paragraph 3 said
"If the type speciïer in a friend declaration designates a (possibly
cv-qualiïed) class type, that class is declared as a friend"
So, following well-formed code should be accepted under the compile option
-std=c++0x.
class Y ;
class X
{
// error on the 2011-01-01 snapshot of gcc 4.6
friend Y ; // OK, Y is class type.
} ;