From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AD2113858D1E; Wed, 30 Nov 2022 19:30:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD2113858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669836616; bh=G1Gm+7xVus4el8KIFXBmCs3RtRivJLkC3HvcHYaBGkE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hX/zugb6jq42eCixxvckIKX8Vg8CsngF9QRWlqyPJlvlSpYeMRWSOV9DNiRitGrs5 V9h4EJJPjJNt1BysiGNynSpCxYfZNxtaDnzj51TOokZIKpbAyiIeTsggPJluKQbHKb KTPhrJTTgNlL/o7JRrFA8DJQQsQ+PpaoclaETKl8= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107938] [11/12/13 Regression] ICE directly returning `this` of `extern` variable in template Date: Wed, 30 Nov 2022 19:30:16 +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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: 11.4 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=3D107938 --- Comment #2 from Andrew Pinski --- Hmm, the following slightly modified testcase works in GCC 8.5.0 but starte= d to ICE in GCC 9.1.0: ``` struct Q { int n; constexpr const Q* operator()(int) const { return this; } }; constexpr Q q{}; template constexpr const Q* p =3D q(0); ``` It is still a regression though.=