From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 8D6C73858414; Thu, 18 Jan 2024 21:03:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D6C73858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705611800; bh=Iu5FJtUXMXeTpaqGA0k3vpyxhwuwD9DL6/o9+S8WAOE=; h=From:To:Subject:Date:From; b=d0iSeKQAbaEbPRU2vN+SB5TH98gIkuiuTFhLh93H8zYSHUsREsSfIe3o57nCI63i9 K+e9RHDKEyKzOk/2U68/344wVYWQmMirSpWEK+/Gygjpugz5H5qsw0J01J5qPs2Xyf a0xpSwqJ5ubA/8D3s3D63NBx8LVRwlyDrUuyhTS4= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-8237] libstdc++: Use variable template to fix -fconcepts-ts error [PR113366] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-13 X-Git-Oldrev: c9262b1d8d74512dfb63131f933cd64505b5497e X-Git-Newrev: 35000c65470792aed3a3c23a3b3fc45db4bec2c4 Message-Id: <20240118210320.8D6C73858414@sourceware.org> Date: Thu, 18 Jan 2024 21:03:20 +0000 (GMT) List-Id: https://gcc.gnu.org/g:35000c65470792aed3a3c23a3b3fc45db4bec2c4 commit r13-8237-g35000c65470792aed3a3c23a3b3fc45db4bec2c4 Author: Jonathan Wakely Date: Sat Jan 13 12:13:33 2024 +0000 libstdc++: Use variable template to fix -fconcepts-ts error [PR113366] There's an error for -fconcepts-ts due to using a concept where a bool NTTP is required, which is fixed by using the vraiable template that already exists in the class scope. This doesn't fix the problem with -fconcepts-ts as changes to the placement of attributes is also needed. libstdc++-v3/ChangeLog: PR testsuite/113366 * include/std/format (basic_format_arg): Use __formattable variable template instead of __format::__formattable_with concept. (cherry picked from commit 6c703b4eb68cbc32de1d62e5b573cb1b9857af29) Diff: --- libstdc++-v3/include/std/format | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index d5ca962423c..401503e895c 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -2847,8 +2847,7 @@ namespace __format // Format as const if possible, to reduce instantiations. template using __maybe_const_t - = __conditional_t<__format::__formattable_with<_Tp, _Context>, - const _Tp, _Tp>; + = __conditional_t<__formattable<_Tp>, const _Tp, _Tp>; template static void @@ -2866,7 +2865,7 @@ namespace __format explicit handle(_Tp& __val) noexcept { - if constexpr (!__format::__formattable_with) + if constexpr (!__formattable) static_assert(!is_const_v<_Tp>, "std::format argument must be " "non-const for this type");