From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 521343858011; Tue, 4 Oct 2022 14:41:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 521343858011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664894509; bh=PkB3GnRVeVInX5nzZJkYsKkZKBxBTTtSY60qPKv9aMk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tesaW5yzT3s6iquHIdW7G63l1NvyCNAF+5spKc5vhCpG5FXZ7FnQXlGkVexk52hN3 bX6xmrJDLORA0ZyX0NysT7guEQgqcWtePdK66oA171LAkadfdz0O9p2iKUauUi8s/2 9VrBUEixnEPrq6kQDJwl56/oZYhnggGoOmbUGig0= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/103924] views::join combined with std::string cannot be used in constant expressions Date: Tue, 04 Oct 2022 14:41:39 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka 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=3D103924 --- Comment #1 from Patrick Palka --- I encountered a similar problem when testing views::join_with: #include #include constexpr std::string_view rs[] =3D {"42"}; static_assert(!std::ranges::empty(rs | std::views::join_with(std::string("")))); error: accessing =E2=80=98std::__cxx11::basic_string::::_M_allocated_capacity=E2=80=99 member instead of initialized =E2=80=98std::__cxx11::basic_string::::_M_local_buf=E2= =80=99 member in constant expression=