From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0E4D1385DC08; Fri, 12 Jan 2024 09:49:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E4D1385DC08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705052959; bh=noQqarpigYO2SVqICUz9Q9gJ3u3Ivrgwj+jZIvE3rDQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xKTqePm06QWWPHanjwLPMIhL/PrzYkLe6nyIj9SM5wAZmA8VNDUtC82XE6y4Inxrp 2AGUgO3qWbbEIYCuBGDo2AnY+az7eU9rvmusSFtX6cMfmHbEyiHj4x8Qt0bfdYvtlp tN10G1mJ8LyoOlFvCqTKP/Bid5q8wxije9OXhWPo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113320] libstdc++ accepts std::format(std::move(runtime_fmt), 42); Date: Fri, 12 Jan 2024 09:49:17 +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: 14.0 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi 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=3D113320 --- Comment #3 from GCC Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:5fbc1b2e7c1bdf11f64765b278f477310c0f3436 commit r14-7174-g5fbc1b2e7c1bdf11f64765b278f477310c0f3436 Author: Jonathan Wakely Date: Wed Jan 10 20:54:11 2024 +0000 libstdc++: Fix std::runtime_format deviations from the spec [PR113320] I seem to have implemented this feature based on the P2918R0 revision, not the final P2918R2 one that was approved for C++26. This commit fixes it. The runtime-format-string type should not have a publicly accessible data member, so add a constructor and make it a friend of basic_format_string. It should also be non-copyable, so that it can only be constructed from a prvalue via temporary materialization. Change the basic_format_string constructor parameter to pass by value. Also add noexcept to the constructors and runtime_format generator functions. libstdc++-v3/ChangeLog: PR libstdc++/113320 * include/std/format (__format::_Runtime_format_string): Add constructor and disable copy operations. (basic_format_string(_Runtime_format_string)): Add noexcept and take parameter by value not rvalue reference. (runtime_format): Add noexcept. * testsuite/std/format/runtime_format.cc: Check noexcept. Check that construction is only possible from prvalues, not xvalues. Reviewed-by: Daniel Kr=C3=BCgler =