From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 609 invoked by alias); 31 Aug 2005 11:07:53 -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 32740 invoked by uid 48); 31 Aug 2005 11:07:41 -0000 Date: Wed, 31 Aug 2005 11:21:00 -0000 Message-ID: <20050831110741.32736.qmail@sourceware.org> From: "reichelt at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20031210171832.13377.boris@kolpackov.net> References: <20031210171832.13377.boris@kolpackov.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13377] [3.4 regression] unexpected behavior of namespace usage directive X-Bugzilla-Reason: CC X-SW-Source: 2005-08/txt/msg03563.txt.bz2 List-Id: ------- Additional Comments From reichelt at gcc dot gnu dot org 2005-08-31 11:07 ------- For the testcase ================================== namespace N { int i; } int i; using namespace N; void foo() { i; } ================================== we now get ambig4.C: In function 'void foo()': ambig4.C:10: error: use of 'i' is ambiguous ambig4.C:6: error: first declared as 'int i' here ambig4.C:3: error: also declared as 'int N::i' here ambig4.C:10: error: 'i' was not declared in this scope Btw, this is the testcase which was a regression from GCC 3.3.x. For the testcase ================================== namespace N { namespace M {} } namespace M {} using namespace N; using namespace M; ================================== we now get (since the patch for PR23586 is also in place): ambig5.C:13: error: use of 'M' is ambiguous ambig5.C:10: error: first declared as 'namespace M { }' here ambig5.C:7: error: also declared as 'namespace M { }' here ambig5.C:13: error: 'M' is not a namespace-name ambig5.C:13: error: expected namespace-name before ';' token This is still a little suboptimal (first we say it's ambiguous, then we say it's not declared/not a namespace-name), but I think the user can figure out the problem now. So this is fixed on mainline and the 4.0 branch. -- What |Removed |Added ---------------------------------------------------------------------------- URL| |http://gcc.gnu.org/ml/gcc- | |patches/2005- | |08/msg01717.html Summary|unexpected behavior of |[3.4 regression] unexpected |namespace usage directive |behavior of namespace usage | |directive Target Milestone|--- |3.4.5 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13377