From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 379A83858C2A; Wed, 3 Jan 2024 12:57:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 379A83858C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704286640; bh=X8Rr2FpFOuG36bvAev6tGrUOzn71jXc0f5GQwuXQ7qE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bxTeC6aE7z4anc37usfE33+tEsidsrcNOud/yLL4GWn8cDlY+G5BX9o8X/oK750Ra gnEN4B6KFaie+vsuaxdu3ammv+VeaEvXFbTFOEnu6BvgTx6ZP35Es3QHLVJZt/sTQ4 uXgUcDHyph4PnUp8HEjRhe/ACa9ba6PMzZZR5mx0= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113200] std::char_traits::move is not constexpr when the argument is a string literal Date: Wed, 03 Jan 2024 12:57:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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: --- 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=3D113200 --- Comment #7 from Jonathan Wakely --- Why does GCC accept this reduced version, which is invalid for the same rea= son as the original? #include constexpr int N =3D 5; struct S { char data_[ N ]; constexpr S( char const* p ) { std::char_traits::move( data_, p, N ); } }; constexpr S s( "test" ); Clang rejects it the same way.=