From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3473A3858001; Thu, 18 Jan 2024 14:12:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3473A3858001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705587144; bh=1RilGquQMawvX3X9fVaPhz7bE4UW9+pPrBvp+S0VmCY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=w3LJaLLcoDlKMwaHUPQXvwqm+AII58rYbUgKseCluhHx7hJ/5THdanJJRkfPxEQWp nCoZPfofr+nq3Q9fStHaNSWTfFz/zJmhVUGrkeAf2/QllfQuRz7vMoPt3cVLNNLrOc +MBZXRheZUE9M5L/t9RnOZv0hmSI6s4uMt1fZh5g= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113389] ICE when explicit object parameter is not declared as the first parameter Date: Thu, 18 Jan 2024 14:12:23 +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: 14.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: 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=3D113389 --- Comment #2 from GCC Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:9840e0be78150b0ef6e29975a6244698d5a5580c commit r14-8239-g9840e0be78150b0ef6e29975a6244698d5a5580c Author: Marek Polacek Date: Wed Jan 17 19:16:32 2024 -0500 c++: ICE when xobj is not the first parm [PR113389] In grokdeclarator/cdk_function the comment says that the find_xobj_parm lambda clears TREE_PURPOSE so that we can correctly detect an xobj that is not the first parameter. That's all good, but we should also clear the TREE_PURPOSE once we've given the error, otherwise we crash later in check_default_argument because the 'this' TREE_PURPOSE lacks a type. PR c++/113389 gcc/cp/ChangeLog: * decl.cc (grokdeclarator) : Set TREE_PURPOS= E to NULL_TREE when emitting an error. gcc/testsuite/ChangeLog: * g++.dg/cpp23/explicit-obj-diagnostics10.C: New test.=