1//===----------------------------------------------------------------------===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9// UNSUPPORTED: c++03, c++11, c++14, c++17
10
11// libc++ supports basic_format_string in C++20 as an extension
12// UNSUPPORTED: !stdlib=libc++ && c++20
13
14// <format>
15
16// template<class... Args>
17// using format_string =
18// basic_format_string<char, type_identity_t<Args>...>;
19// template<class... Args>
20// using wformat_string =
21// basic_format_string<wchar_t, type_identity_t<Args>...>;
22
23#include <format>
24
25#include <concepts>
26
27#include "test_macros.h"
28
29static_assert(std::same_as<std::format_string<>, std::basic_format_string<char>>);
30static_assert(std::same_as<std::format_string<int>, std::basic_format_string<char, int>>);
31static_assert(std::same_as<std::format_string<int, bool>, std::basic_format_string<char, int, bool>>);
32static_assert(std::same_as<std::format_string<int, bool, void*>, std::basic_format_string<char, int, bool, void*>>);
33#ifndef TEST_HAS_NO_WIDE_CHARACTERS
34static_assert(std::same_as<std::wformat_string<>, std::basic_format_string<wchar_t>>);
35static_assert(std::same_as<std::wformat_string<int>, std::basic_format_string<wchar_t, int>>);
36static_assert(std::same_as<std::wformat_string<int, bool>, std::basic_format_string<wchar_t, int, bool>>);
37static_assert(std::same_as<std::wformat_string<int, bool, void*>, std::basic_format_string<wchar_t, int, bool, void*>>);
38#endif
39

source code of libcxx/test/std/utilities/format/format.fmt.string/types.compile.pass.cpp