From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 39EAF3858C33; Wed, 28 Sep 2022 21:58:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39EAF3858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664402304; bh=sevAp7HOYphPKNyJfvAReo0Sm2xEUEGFsRGXnH633hc=; h=From:To:Subject:Date:From; b=ftYkVmT9uMqzT0qqiyJEbiKQ+qtnTiJFVfzC95M1uEtf16/2wUcy+xvsqrZrZ+7IO yIioLf4pDtHfd3e2yobBbvvue+R/4o1Pyt7GN7fPlQ2YDeRIt8n66xIvfPWW/wb+/n mGYsnwQKoy+6b355NRgPb877uOB7/nHwLl4QXs4M= From: "johelegp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107079] New: ICE initializing lifetime-extended constexpr variable that stores its this pointer Date: Wed, 28 Sep 2022 21:58:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: johelegp at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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=3D107079 Bug ID: 107079 Summary: ICE initializing lifetime-extended constexpr variable that stores its this pointer Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/5asqcnoMe. ```C++ struct X { const X* x =3D this; }; constexpr const X& x =3D X{}; ``` ``` :4:26: internal compiler error: in cxx_eval_constant_expression, at cp/constexpr.cc:7591 4 | constexpr const X& x =3D X{}; | ^ 0x23507de internal_error(char const*, ...) ???:0 0xa9ea08 fancy_abort(char const*, int, char const*) ???:0 0xd4f2da store_init_value(tree_node*, tree_node*, vec**, int) ???:0 0xb78f38 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ???:0 0xc786f7 c_parse_file() ???:0 0xdb4a19 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. Compiler returned: 1 ```=