https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82478

--- Comment #2 from Corey Tabaka <eieio at google dot com> ---
From section 11.3.2 of the C++14 draft spec:

"Declaring a class to be a friend implies that the names of private and
protected members from the class granting friendship can be accessed in the
base-specifiers and member declarations of the befriended class."

I take "can be accessed in base-specifiers" to mean any expression in the base
specifiers of class B is granted access to private and protected members of
class A if class A declares class B to be a friend. Do you agree that this is a
valid interpretation?

Furthermore, regardless of the interpretation above, in the example supplied
the class Outer should have friend access to private members of A, and thus the
nested definition of Outer::HasPrivate should have valid access to A::PRIVATE.
This also fails to compile with a similar error as the top-level example --
clearly this is not the correct behavior.

Reply via email to