From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9970E3857B85; Mon, 24 Oct 2022 08:50:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9970E3857B85 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666601449; bh=217WwKvY5WeOxqvCzaBweLPi3L3/k/Q2M+100+Ie34g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XBcvzNe0BDtXg1Ib9icUbXPttAR+2NKskeAiqQcTMJWoXi1FU1PRGkuiDqs1iBQH2 gpvzfKtNhiMqR8WpkKcwBE+ton2FCtlaMvX3Sky7yY7OBlRRnCEOfg6GwDCcGQy6P7 2lafameSo3t1DbrmkEitQMRElgMB+BW3+cblKIvY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags` Date: Mon, 24 Oct 2022 08:50:47 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105725 --- Comment #6 from CVS Commits --- The releases/gcc-11 branch has been updated by Richard Biener : https://gcc.gnu.org/g:bd0c76a2329e7fe6d6612c2259647bbb67f5866a commit r11-10332-gbd0c76a2329e7fe6d6612c2259647bbb67f5866a Author: Marek Polacek Date: Fri May 27 10:51:30 2022 -0400 c++: Fix ICE with -Wmismatched-tags [PR105725] Here we ICE with -Wmismatched-tags on something like template bool B>>; Specifically, the "class T::foo" bit. There, class_decl_loc_t::add gets a TYPENAME_TYPE as TYPE, rather than a class/union type, so checking TYPE_BEING_DEFINED will crash. I think it's OK to allow a TYPENAME_TYP= E to slip into that function; we just shouldn't consider the 'class' tag redundant (which works as a 'typename'). In fact, every other compiler *requires* it. PR c++/105725 gcc/cp/ChangeLog: * parser.c (class_decl_loc_t::add): Check CLASS_TYPE_P. gcc/testsuite/ChangeLog: * g++.dg/warn/Wmismatched-tags-10.C: New test. (cherry picked from commit d822f4bbd714c6595f70cc68888dcebecfb6662d)=