From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A062E3858D1E; Thu, 3 Aug 2023 17:11:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A062E3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691082668; bh=oxG/E0MqHGH1yh53n0GhCvdBICz0LJW8cM3N0Nota9c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CYK8lG1ihrWfoIQaSvum6cUwxi0KvvZJwMYvT1xSp5vyZ9pUtBdEji6mPINd89RcK lJ//u1WYOVIvGaVhywKo1sajDaG3WFb2G/XMsUfA57C39KZ29kbyJH1B7SxWSBx6SQ S07rumgPY5RrvWeoYfOzpYkrw4vj+KR4W3jFWKjg= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110158] Cannot use union with std::string inside in constant expression Date: Thu, 03 Aug 2023 17:11:06 +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.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org 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: cc see_also 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=3D110158 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ppalka at gcc dot gnu.org See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D110245 --- Comment #2 from Patrick Palka --- It works if we activate the union's member: constexpr bool f() { union U{ std::string s =3D {}; constexpr ~U(){ s.~basic_string(); } } u{}; return true; } static_assert( f() ); So perhaps this is a dup of PR110245?=