[Bug c++/58054] 11.3 Friends, example from standard not compiled

2013-08-04 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58054

Andrew Pinski  changed:

   What|Removed |Added

 CC||ppluzhnikov at google dot com

--- Comment #4 from Andrew Pinski  ---
*** Bug 58053 has been marked as a duplicate of this bug. ***


[Bug c++/58054] 11.3 Friends, example from standard not compiled

2013-08-02 Thread dushistov at mail dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58054

--- Comment #3 from Evgeniy Dushistov  ---
Here history of changes of C++ standard that related to this bug:

http://wg21.cmeerw.net/cwg/issue372


[Bug c++/58054] 11.3 Friends, example from standard not compiled

2013-08-02 Thread dushistov at mail dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58054

--- Comment #2 from Evgeniy Dushistov  ---
Yes, for C++ 2003 this is invalid code(page 212):

class A {
class B { };
friend class X;
};
class X : A::B { // ill-formed: A::B cannot be accessed
// in the base-clause for X
A::B mx; // OK: A::B used to declare member of X
class Y : A::B { // OK: A::B used to declare member of X
A::B my; // ill-formed: A::B cannot be accessed
// to declare members of nested class of X
};
};

but for 2011 they looks like change behaviour.


[Bug c++/58054] 11.3 Friends, example from standard not compiled

2013-08-01 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58054

--- Comment #1 from Andrew Pinski  ---
Looks like they changed how base classes are handled in C++ for C++11.
98 says this:
[class.friend]/2 

"Also, because the base-clause of the friend class is not 
part of its member declarations, the base-clause of the friend class cannot 
access the names of the private and protected members from the class granting 
friendship."

Or is this just in a need for a defect report.