From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31236 invoked by alias); 22 Apr 2014 21:31:14 -0000 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 Received: (qmail 30627 invoked by uid 48); 22 Apr 2014 21:31:08 -0000 From: "filip.roseen at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60927] New: Ambiguity not caught when name introduced through using-directive conflicts with previously declared entity Date: Tue, 22 Apr 2014 21:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: filip.roseen at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg01641.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60927 Bug ID: 60927 Summary: Ambiguity not caught when name introduced through using-directive conflicts with previously declared entity Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: filip.roseen at gmail dot com Created attachment 32656 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32656&action=edit testcase.cpp namespace N { namespace A { int x = 1; } } struct A { static int x; }; int main () { using namespace N; A::x = 123; } ---------------------------------------------------- `gcc` accepts the above even though there's an ambiguity between `N::A::x` and `A::x` when referenced as `A::x` in `main`. ------------------------------------------------------ [ note: `gcc` treats the `A::x` as referring to `N::A::x`. ] [ note: `clang` shows the correct behaviour and issues a diagnostic saying that `A::x` is ambiguous. ]