From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21989 invoked by alias); 30 Oct 2009 12:14:39 -0000 Received: (qmail 21954 invoked by uid 48); 30 Oct 2009 12:14:28 -0000 Date: Fri, 30 Oct 2009 12:14:00 -0000 Message-ID: <20091030121428.21953.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/36163] Friend declaration confused by namespace/using In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "redi at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg02520.txt.bz2 ------- 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