]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Use variable template to fix -fconcepts-ts error [PR113366]
authorJonathan Wakely <jwakely@redhat.com>
Sat, 13 Jan 2024 12:13:33 +0000 (12:13 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 15 Jan 2024 16:59:27 +0000 (16:59 +0000)
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.

libstdc++-v3/include/std/format

index 540f8b805f8da7d4b3c91009148bdfe4c5f25f30..efc4a17ba363f911d2b55ffacd2c78d4c6da8e3d 100644 (file)
@@ -3189,8 +3189,7 @@ namespace __format
        // Format as const if possible, to reduce instantiations.
        template<typename _Tp>
          using __maybe_const_t
-           = __conditional_t<__format::__formattable_with<_Tp, _Context>,
-                             const _Tp, _Tp>;
+           = __conditional_t<__formattable<_Tp>, const _Tp, _Tp>;
 
        template<typename _Tq>
          static void
@@ -3208,7 +3207,7 @@ namespace __format
          explicit
          handle(_Tp& __val) noexcept
          {
-           if constexpr (!__format::__formattable_with<const _Tp, _Context>)
+           if constexpr (!__formattable<const _Tp>)
              static_assert(!is_const_v<_Tp>, "std::format argument must be "
                                              "non-const for this type");