From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A5E8A39F4405; Fri, 5 Feb 2021 16:07:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5E8A39F4405 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96462] [10/11 Regression] ICE in tree check: expected identifier_node, have bit_not_expr in find_namespace_slot, at cp/name-lookup.c:97 Date: Fri, 05 Feb 2021 16:07:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Fri, 05 Feb 2021 16:07:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96462 --- Comment #5 from CVS Commits --- The master branch has been updated by Marek Polacek : https://gcc.gnu.org/g:1cbc10d894494c34987d1f42f955e7843457ee38 commit r11-7125-g1cbc10d894494c34987d1f42f955e7843457ee38 Author: Marek Polacek Date: Thu Feb 4 12:53:59 2021 -0500 c++: Fix ICE with invalid using enum [PR96462] Here we ICE in finish_nonmember_using_decl -> lookup_using_decl -> ... -> find_namespace_slot because "name" is not an IDENTIFIER_NODE. It is a BIT_NOT_EXPR because this broken test uses using E::~E; // SCOPE::NAME A using-decl can't refer to a destructor, and lookup_using_decl already checks that in the class member case. But in C++17, we do the "enum scope is the enclosing scope" block, and so scope gets set to ::, and we go into the NAMESPACE_DECL block. In C++20 we don't do it, we go to the ENUMERAL_TYPE block. I resorted to hoisting the check along with a diagnostic tweak: we don't want to print "::::~E names destructor". gcc/cp/ChangeLog: PR c++/96462 * name-lookup.c (lookup_using_decl): Hoist the destructor check. gcc/testsuite/ChangeLog: PR c++/96462 * g++.dg/cpp2a/using-enum-8.C: New test.=