From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BBFEF3865C2D; Sat, 1 May 2021 03:16:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BBFEF3865C2D From: "rs2740 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100368] New: Missing guaranteed elision in constexpr evaluation Date: Sat, 01 May 2021 03:16:12 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rs2740 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 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 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: Sat, 01 May 2021 03:16:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100368 Bug ID: 100368 Summary: Missing guaranteed elision in constexpr evaluation Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rs2740 at gmail dot com Target Milestone: --- struct S { S() =3D default; S(const S&) =3D delete; }; struct array { S s[2]; }; struct PS { constexpr array operator*() const { return {}; } }; struct W { constexpr W(const PS& p) // 1 : t(*p) {} array t; }; W w(PS{}); This issues a spurious complaint on trunk and then ICEs: source>: In constructor 'constexpr W::W(const PS&)': :17:14: error: use of deleted function 'array::array(array&&)' 17 | : t(*p) {} | ^ :7:8: note: 'array::array(array&&)' is implicitly deleted because t= he default definition would be ill-formed: 7 | struct array { | ^~~~~ :7:8: error: use of deleted function 'S::S(S&&)' :4:3: note: declared here 4 | S(S&&) =3D delete; | ^ :17:14: internal compiler error: tree check: expected target_expr, = have error_mark in bot_manip, at cp/tree.c:3095 17 | : t(*p) {} | ^ 0x1d002c9 internal_error(char const*, ...) ???:0 0x67b4e3 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ???:0 0x13967e3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*)) ???:0 0x9ad0ae break_out_target_exprs(tree_node*, bool) ???:0 0x72aa0a maybe_save_constexpr_fundef(tree_node*) ???:0 0x7b0711 finish_function(bool) ???:0 0x8e2c4d c_parse_file() ???:0 0xa63232 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. Removing the constexpr on the line marked #1 makes it compile. Both clang a= nd MSVC accept the original code.=