From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 60EB33858D32; Mon, 15 Jan 2024 17:18:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60EB33858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705339091; bh=6YF9gGzclUZDLjTxJnB8m8pRwkNcexzFDrDsf5cJRZE=; h=From:To:Subject:Date:From; b=VEuahteI9klP8J3dijNpCDbtZfJLzXLlLkkinM4re3Ze8jGBsrdM5e9p7aolS+EB3 ws/w3T1nH2N7k4hbS2ypR8Twgu7y4JyjER+PWbgb7c/+aevIG0EvDm4KtdZqFnPE6A DW/DmYvY6hlaJ0iUcPGvvPclCtBnYCXMbNB2gUFY= 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 r14-7255] libstdc++: Use variable template to fix -fconcepts-ts error [PR113366] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 4f141b051ef4476da2cd39c622b2eae73c696d88 X-Git-Newrev: 6c703b4eb68cbc32de1d62e5b573cb1b9857af29 Message-Id: <20240115171811.60EB33858D32@sourceware.org> Date: Mon, 15 Jan 2024 17:18:11 +0000 (GMT) List-Id: https://gcc.gnu.org/g:6c703b4eb68cbc32de1d62e5b573cb1b9857af29 commit r14-7255-g6c703b4eb68cbc32de1d62e5b573cb1b9857af29 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. 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 540f8b805f8..efc4a17ba36 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -3189,8 +3189,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 @@ -3208,7 +3207,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");