From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3DEA63851C0F; Mon, 9 Aug 2021 09:03:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3DEA63851C0F From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94162] ICE [neg] bad return type in defaulted <=> Date: Mon, 09 Aug 2021 09:03:44 +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: 10.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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: Mon, 09 Aug 2021 09:03:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94162 --- Comment #12 from Jakub Jelinek --- At least the #c8 testcase got fixed with r12-619-gfc178519771db508c03611cff4a1466cf67fce1d but that hasn't been backported to 11.x. The ICE with int * return type is because POINTER_TYPE has NULL TYPE_LINKAGE_IDENTIFIER, and cat_type_for is called on such type. --- gcc/cp/method.c.jj 2021-06-28 22:38:27.014617793 +0200 +++ gcc/cp/method.c 2021-08-09 10:59:02.324443669 +0200 @@ -1029,6 +1029,8 @@ is_cat (tree type, comp_cat_tag tag) static comp_cat_tag cat_tag_for (tree type) { + if (!TYPE_LINKAGE_IDENTIFIER (type)) + return cc_last; for (int i =3D 0; i < cc_last; ++i) { comp_cat_tag tag =3D (comp_cat_tag)i; would fix this (or shall we instead test if (!CLASS_TYPE_P (type)) or somet= hing similar?=