From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 65188383E80F; Mon, 22 Jun 2020 06:43:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65188383E80F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592808214; bh=rVmnpISTnypldLwd0wn8NTmJWJwRZ38x1G/4gZ9v3GI=; h=From:To:Subject:Date:From; b=mMmB7auigtq/xzsaYWVKmpmSCF+eQO371qwJuTd4VR11PW8ansXiIWpF6OzAwSxMF ihavwvIHUCccr2lPp0aCq/jbfCX/vtGTCj0Y9mp5ZfcbouRgY4VEKkjI6Q9HbQaDb5 lvXHc+cQi7BDt8fzB8vUN8+ulMBgV+SMZAZEqDYE= From: "haoxintu at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95809] New: GCC treats inline namespace declaration as "ambiguous" Date: Mon, 22 Jun 2020 06:43:34 +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: 11.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: haoxintu at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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 keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2020 06:43:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95809 Bug ID: 95809 Summary: GCC treats inline namespace declaration as "ambiguous" Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This code, bug.cc, GCC fails to compile it, while clang, icc, or msvc accep= ts it well. $cat bug.cc namespace g_namespace {} inline namespace { namespace g_namespace {} } namespace g_namespace {} $g++ -c bug.cc bug.cc:5:12: error: =E2=80=98namespace g_namespace=E2=80=99 is ambiguous 5 | namespace g_namespace {} | ^~~~~~~~~~~ bug.cc:3:15: note: candidates are: =E2=80=98namespace ::g_namespac= e { }=E2=80=99 3 | namespace g_namespace {} | ^~~~~~~~~~~ bug.cc:1:11: note: =E2=80=98namespace g_namespace { }=E2=80= =99 1 | namespace g_namespace {} | ^~~~~~~~~~~ My GCC version is g++ (GCC) 11.0.0 20200605 (experimental) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. When I remove the keyword "inline", GCC accepts it well. So, I guess GCC mi= ght can not detect the inline namespace declaration and separate its inside namespace from outside ones.=