This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36163] Friend declaration confused by namespace/using
- From: "redi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Oct 2009 12:14:28 -0000
- Subject: [Bug c++/36163] Friend declaration confused by namespace/using
- References: <bug-36163-6594@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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