From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8813 invoked by alias); 10 Mar 2004 16:24:01 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 8806 invoked by uid 48); 10 Mar 2004 16:24:01 -0000 Date: Wed, 10 Mar 2004 16:24:00 -0000 Message-ID: <20040310162401.8803.qmail@sources.redhat.com> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040310154252.14513.bugzilla-gcc@thewrittenword.com> References: <20040310154252.14513.bugzilla-gcc@thewrittenword.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/14513] Friend name injection problem (implicit declaration) X-Bugzilla-Reason: CC X-SW-Source: 2004-03/txt/msg01232.txt.bz2 List-Id: ------- Additional Comments From bangerth at dealii dot org 2004-03-10 16:24 ------- OK, so here's what happens: ------------ struct S { void test (void); }; namespace NS { class X { friend class S; static int *i; }; } void S::test () { NS::X::i; } --------------- gcc thinks the 'friend class S' declaration refers to class ::S and thus allows the access in S::test. All the other compilers seem to believe that the friend declaration refer to a yet-to-be-declared class NS::S, and therefore don't allow access in ::S::test. I have yet to understand what the standard really says in this respect. Kriang? W. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |lerdsuwa at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14513