Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Differential D110494 Diff 375090 libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// UNSUPPORTED: c++03, c++11, c++14, c++17 | // UNSUPPORTED: c++03, c++11, c++14, c++17 | ||||
// UNSUPPORTED: libcpp-no-concepts | // UNSUPPORTED: libcpp-no-concepts | ||||
// UNSUPPORTED: libcpp-has-no-incomplete-format | // UNSUPPORTED: libcpp-has-no-incomplete-format | ||||
// <format> | // <format> | ||||
// Namespace std typedefs: | // Namespace std typedefs: | ||||
// using format_args = basic_format_args<format_context>; | // using format_args = basic_format_args<format_context>; | ||||
// using wformat_args = basic_format_args<wformat_context>; | // using wformat_args = basic_format_args<wformat_context>; | ||||
// template<class Out, class charT> | |||||
// using format_args_t = basic_format_args<basic_format_context<Out, charT>>; | |||||
#include <format> | #include <format> | ||||
#include <vector> | #include <vector> | ||||
#include <type_traits> | #include <type_traits> | ||||
#include "test_macros.h" | #include "test_macros.h" | ||||
static_assert(std::is_same_v<std::format_args, | static_assert(std::is_same_v<std::format_args, | ||||
std::basic_format_args<std::format_context>>); | std::basic_format_args<std::format_context>>); | ||||
static_assert(std::is_same_v<std::wformat_args, | static_assert(std::is_same_v<std::wformat_args, | ||||
std::basic_format_args<std::wformat_context>>); | std::basic_format_args<std::wformat_context>>); | ||||
static_assert(std::is_same_v< | |||||
std::format_args_t<std::back_insert_iterator<std::string>, char>, | |||||
std::basic_format_args<std::basic_format_context< | |||||
std::back_insert_iterator<std::string>, char>>>); | |||||
static_assert( | |||||
std::is_same_v< | |||||
std::format_args_t<std::back_insert_iterator<std::wstring>, wchar_t>, | |||||
std::basic_format_args<std::basic_format_context< | |||||
std::back_insert_iterator<std::wstring>, wchar_t>>>); | |||||
static_assert( | |||||
std::is_same_v< | |||||
std::format_args_t<std::back_insert_iterator<std::vector<char>>, char>, | |||||
std::basic_format_args<std::basic_format_context< | |||||
std::back_insert_iterator<std::vector<char>>, char>>>); | |||||
// Required for MSVC internal test runner compatibility. | // Required for MSVC internal test runner compatibility. | ||||
int main(int, char**) { return 0; } | int main(int, char**) { return 0; } |