This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [wwwdocs PATCH] Document friend changes in gcc-4.0/changes.html
Mark Mitchell wrote:
OK; I did not intend to change the meaning. But, I do not find your
wording clear. How about "When declaring a friend class using an
unqualified name, if name-lookup does not find the friend class, the
friend declaration is considered to be a forward declaration of a member
class, rather than a class in the containing namespace."?
Hmm, the entry is about where to do name-lookup for an existing name,
not where to put an undeclared name. So I am proposing this version:
"When declaring a friend class using an unqualified name,
classes outside the innermost non-class scope are not searched."
I have some quotes from the standard at the end of this mail for
comparison.
OK with this change?
--Kriang
Quotes from the standard:
-------------------------
7.3.1.2/3:
When looking for prior declaration of a class or a function declared
as friend, scopes outside the innermost enclosing namespace scope are
not considered.
11.4/9:
If a friend declaration appears in a local class (9.8) and the name
specified is an unqualified name, a prior declaration is looked up
without considering scopes that are outside the innermost enclosing
non-class scope.