1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
13 // template<class T, class charT>
14 // concept formattable = ...
19 #include "test_macros.h"
21 template <class T
, class CharT
>
22 void assert_is_not_formattable() {
23 static_assert(!std::formattable
<T
, CharT
>);
26 template <class T
, class CharT
>
27 void assert_is_formattable() {
28 // Only formatters for CharT == char || CharT == wchar_t are enabled for the
29 // standard formatters. When CharT is a different type the formatter should
31 if constexpr (std::same_as
<CharT
, char>
32 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
33 || std::same_as
<CharT
, wchar_t>
36 static_assert(std::formattable
<T
, CharT
>);
38 assert_is_not_formattable
<T
, CharT
>();
41 template <class CharT
>
43 assert_is_formattable
<float, CharT
>();
44 assert_is_formattable
<double, CharT
>();
45 assert_is_formattable
<long double, CharT
>();
50 #ifndef TEST_HAS_NO_WIDE_CHARACTERS