| 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 | // <format> |
| 12 | |
| 13 | // basic_format_arg() noexcept; |
| 14 | |
| 15 | // The class has several exposition only private constructors. These are tested |
| 16 | // in visit_format_arg.pass.cpp |
| 17 | |
| 18 | #include <format> |
| 19 | #include <cassert> |
| 20 | |
| 21 | #include "test_macros.h" |
| 22 | |
| 23 | template <class CharT> |
| 24 | void test() { |
| 25 | using Context = std::basic_format_context<CharT*, CharT>; |
| 26 | |
| 27 | ASSERT_NOEXCEPT(std::basic_format_arg<Context>{}); |
| 28 | |
| 29 | std::basic_format_arg<Context> format_arg{}; |
| 30 | assert(!format_arg); |
| 31 | } |
| 32 | |
| 33 | void test() { |
| 34 | test<char>(); |
| 35 | #ifndef TEST_HAS_NO_WIDE_CHARACTERS |
| 36 | test<wchar_t>(); |
| 37 | #endif |
| 38 | #ifndef TEST_HAS_NO_CHAR8_T |
| 39 | test<char8_t>(); |
| 40 | #endif |
| 41 | test<char16_t>(); |
| 42 | test<char32_t>(); |
| 43 | } |
| 44 | |
| 45 | int main(int, char**) { |
| 46 | test(); |
| 47 | |
| 48 | return 0; |
| 49 | } |
| 50 | |