This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47210] New: Compile error on type speciïer in a friend declaration designates a class type


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.
} ;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]