From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B21053858D1E; Fri, 4 Aug 2023 20:41:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B21053858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691181713; bh=Z1rhVsbQ4MgdJg0WEhKb+Wx56zDY9yzWSi3Nc1fZn0I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PtGhW+VqcSwamP78zTv/ehBiZy+RdfrlYoxsuvdfe2/Nvky9oROqxsakqhlIfBMme Ame1JkRzy4dyn+loXI/nBVI7+iEh59pQxdj9NXeCdpO2mBwZf2C3zfl3BIMrl9ewKF NX3EFLwcXPy7+xfF3/mlOgNV5k/06Urc0iexWsww= From: "danakj at orodu dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110905] GCC rejects constexpr code that may re-initialize union member Date: Fri, 04 Aug 2023 20:41:53 +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.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: danakj at orodu dot net X-Bugzilla-Status: WAITING 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110905 --- Comment #2 from danakj at orodu dot net --- Ah ok. Here's a big reproduction: https://godbolt.org/z/Kj7Tcd6P4 /opt/compiler-explorer/gcc-trunk-20230804/include/c++/14.0.0/bits/stl_const= ruct.h:97:14: in 'constexpr' expansion of '((sus::containers::VecIntoIter*))->sus::containe= rs::VecIntoIter::VecIntoIter((* & std::forward >((* & __args#0)= )))' :32895:22: error: use of deleted function 'sus::option::__private::Storage, false>::::()' 32895 | struct [[nodiscard]] VecIntoIter final | ^~~~~~~~~~~ :3015:9: note: 'sus::option::__private::Storage, false>::::()' is implicitly deleted because the default definition would be ill-formed: 3015 | union { | ^ :3015:9: error: no matching function for call to 'sus::containers::VecIntoIter::VecIntoIter()' :32953:13: note: candidate: 'constexpr sus::containers::VecIntoIter::VecIntoIter(sus::containers::Vec&&, sus::num::usize, sus::num::usize) [with ItemT =3D sus::num::i32]' 32953 | constexpr VecIntoIter(Vec&& vec, usize front, usize back) noexcept | ^~~~~~~~~~~ :32953:13: note: candidate expects 3 arguments, 0 provided :32951:13: note: candidate: 'constexpr sus::containers::VecIntoIter::VecIntoIter(sus::containers::Vec&&) [with ItemT =3D sus::num::i32]' 32951 | constexpr VecIntoIter(Vec&& vec) noexcept : vec_(::sus::move(vec)) {} | ^~~~~~~~~~~ :32951:13: note: candidate expects 1 argument, 0 provided :32895:22: note: candidate: 'constexpr sus::containers::VecIntoIter::VecIntoIter(sus::containers::V= ecIntoIter&&)' 32895 | struct [[nodiscard]] VecIntoIter final | ^~~~~~~~~~~ :32895:22: note: candidate expects 1 argument, 0 provided Compiler returned: 1 I will try to shrink it now.=