http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47210
Summary: Compile error on type specifier in a friend declaration
designates a class type
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
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 specifier in a friend declaration designates a (possibly
cv-qualified) 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.
} ;