Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Differential D144331 Diff 511892 libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | #ifndef TEST_HAS_NO_LOCALIZATION | ||||
//assert_is_formattable<std::chrono::zoned_time, CharT>(); | //assert_is_formattable<std::chrono::zoned_time, CharT>(); | ||||
#endif // TEST_HAS_NO_LOCALIZATION | #endif // TEST_HAS_NO_LOCALIZATION | ||||
} | } | ||||
// Tests for P1636 Formatters for library types | // Tests for P1636 Formatters for library types | ||||
// | // | ||||
// The paper hasn't been voted in so currently all formatters are disabled. | // The paper hasn't been voted in so currently all formatters are disabled. | ||||
// TODO validate whether the test is correct after the paper has been accepted. | // Note the paper has been abandoned, the types are kept since other papers may | ||||
// introduce these formatters. | |||||
template <class CharT> | template <class CharT> | ||||
void test_P1636() { | void test_P1636() { | ||||
assert_is_not_formattable<std::basic_streambuf<CharT>, CharT>(); | assert_is_not_formattable<std::basic_streambuf<CharT>, CharT>(); | ||||
assert_is_not_formattable<std::bitset<42>, CharT>(); | assert_is_not_formattable<std::bitset<42>, CharT>(); | ||||
assert_is_not_formattable<std::complex<double>, CharT>(); | assert_is_not_formattable<std::complex<double>, CharT>(); | ||||
assert_is_not_formattable<std::error_code, CharT>(); | assert_is_not_formattable<std::error_code, CharT>(); | ||||
#ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY | #ifndef TEST_HAS_NO_FILESYSTEM_LIBRARY | ||||
assert_is_not_formattable<std::filesystem::path, CharT>(); | assert_is_not_formattable<std::filesystem::path, CharT>(); | ||||
#endif | #endif | ||||
assert_is_not_formattable<std::shared_ptr<int>, CharT>(); | assert_is_not_formattable<std::shared_ptr<int>, CharT>(); | ||||
#ifndef TEST_HAS_NO_LOCALIZATION | #ifndef TEST_HAS_NO_LOCALIZATION | ||||
if constexpr (!std::same_as<CharT, int>) // sub_match only works with proper character types | if constexpr (!std::same_as<CharT, int>) // sub_match only works with proper character types | ||||
assert_is_not_formattable<std::sub_match<CharT*>, CharT>(); | assert_is_not_formattable<std::sub_match<CharT*>, CharT>(); | ||||
#endif | #endif | ||||
#ifndef TEST_HAS_NO_THREADS | #ifndef TEST_HAS_NO_THREADS | ||||
assert_is_not_formattable<std::thread::id, CharT>(); | assert_is_formattable<std::thread::id, CharT>(); | ||||
#endif | #endif | ||||
assert_is_not_formattable<std::unique_ptr<int>, CharT>(); | assert_is_not_formattable<std::unique_ptr<int>, CharT>(); | ||||
} | } | ||||
template <class CharT, class Vector> | template <class CharT, class Vector> | ||||
void test_P2286_vector_bool() { | void test_P2286_vector_bool() { | ||||
assert_is_formattable<Vector, CharT>(); | assert_is_formattable<Vector, CharT>(); | ||||
assert_is_formattable<typename Vector::reference, CharT>(); | assert_is_formattable<typename Vector::reference, CharT>(); | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |