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++/36163] Friend declaration confused by namespace/using



------- Comment #4 from redi at gcc dot gnu dot org  2009-10-30 12:14 -------
(In reply to comment #2)
> Isn't ::foo the using'd class from name?

No, see 7.3.1.2 [namespace.memdef]/3 - an unqualified friend declaration refers
to a member of the innermost enclosing namespace. Names brought into a
namespace scope by a using directive are not members of a namespace.

> If not, how does one befriend a class
> that comes from a using?

You don't, you need to qualify it with the namespace


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36163


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