1 | //===----------------------------------------------------------------------===// |
2 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
3 | // See https://llvm.org/LICENSE.txt for license information. |
4 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
5 | // |
6 | //===----------------------------------------------------------------------===// |
7 | |
8 | // UNSUPPORTED: c++03, c++11, c++14, c++17 |
9 | |
10 | // <format> |
11 | |
12 | // basic_format_arg() noexcept; |
13 | |
14 | // The class has several exposition only private constructors. These are tested |
15 | // in visit_format_arg.pass.cpp |
16 | |
17 | #include <format> |
18 | #include <cassert> |
19 | |
20 | #include "test_macros.h" |
21 | |
22 | template <class CharT> |
23 | void test() { |
24 | using Context = std::basic_format_context<CharT*, CharT>; |
25 | |
26 | ASSERT_NOEXCEPT(std::basic_format_arg<Context>{}); |
27 | |
28 | std::basic_format_arg<Context> format_arg{}; |
29 | assert(!format_arg); |
30 | } |
31 | |
32 | void test() { |
33 | test<char>(); |
34 | #ifndef TEST_HAS_NO_WIDE_CHARACTERS |
35 | test<wchar_t>(); |
36 | #endif |
37 | #ifndef TEST_HAS_NO_CHAR8_T |
38 | test<char8_t>(); |
39 | #endif |
40 | test<char16_t>(); |
41 | test<char32_t>(); |
42 | } |
43 | |
44 | int main(int, char**) { |
45 | test(); |
46 | |
47 | return 0; |
48 | } |
49 | |