diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -292,7 +292,6 @@ #include <__config> #include <__debug> #include <__format/enable_insertable.h> -#include <__format/formatter.h> #include <__functional/hash.h> #include <__functional/unary_function.h> #include <__iterator/advance.h> @@ -323,6 +322,13 @@ #include #include +// TODO FMT Make these normal includes after transitive includes are +// removed from older language versions. +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) && _LIBCPP_STD_VER >= 23 +# include <__format/formatter.h> +# include <__format/formatter_bool.h> +#endif + // standard-mandated includes // [iterator.range] diff --git a/libcxx/test/libcxx/private_headers.verify.cpp b/libcxx/test/libcxx/private_headers.verify.cpp --- a/libcxx/test/libcxx/private_headers.verify.cpp +++ b/libcxx/test/libcxx/private_headers.verify.cpp @@ -44,6 +44,7 @@ // DO NOT MANUALLY EDIT ANYTHING BETWEEN THE MARKERS BELOW // GENERATED-MARKER +#include <__algorithm/.move.h.swp> // expected-error@*:* {{use of private header from outside its module: '__algorithm/.move.h.swp'}} #include <__algorithm/adjacent_find.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/adjacent_find.h'}} #include <__algorithm/all_of.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/all_of.h'}} #include <__algorithm/any_of.h> // expected-error@*:* {{use of private header from outside its module: '__algorithm/any_of.h'}} @@ -426,6 +427,7 @@ #include <__functional/unary_negate.h> // expected-error@*:* {{use of private header from outside its module: '__functional/unary_negate.h'}} #include <__functional/unwrap_ref.h> // expected-error@*:* {{use of private header from outside its module: '__functional/unwrap_ref.h'}} #include <__functional/weak_result_type.h> // expected-error@*:* {{use of private header from outside its module: '__functional/weak_result_type.h'}} +#include <__fwd/.array.h.swp> // expected-error@*:* {{use of private header from outside its module: '__fwd/.array.h.swp'}} #include <__fwd/array.h> // expected-error@*:* {{use of private header from outside its module: '__fwd/array.h'}} #include <__fwd/fstream.h> // expected-error@*:* {{use of private header from outside its module: '__fwd/fstream.h'}} #include <__fwd/get.h> // expected-error@*:* {{use of private header from outside its module: '__fwd/get.h'}} @@ -766,6 +768,7 @@ #include <__type_traits/type_list.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/type_list.h'}} #include <__type_traits/underlying_type.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/underlying_type.h'}} #include <__type_traits/void_t.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/void_t.h'}} +#include <__utility/.pair.h.swp> // expected-error@*:* {{use of private header from outside its module: '__utility/.pair.h.swp'}} #include <__utility/as_const.h> // expected-error@*:* {{use of private header from outside its module: '__utility/as_const.h'}} #include <__utility/auto_cast.h> // expected-error@*:* {{use of private header from outside its module: '__utility/auto_cast.h'}} #include <__utility/cmp.h> // expected-error@*:* {{use of private header from outside its module: '__utility/cmp.h'}} diff --git a/libcxx/test/libcxx/transitive_includes/cxx2b.csv b/libcxx/test/libcxx/transitive_includes/cxx2b.csv --- a/libcxx/test/libcxx/transitive_includes/cxx2b.csv +++ b/libcxx/test/libcxx/transitive_includes/cxx2b.csv @@ -646,15 +646,21 @@ variant new variant tuple variant version +vector array +vector cerrno vector climits vector compare vector cstddef vector cstdint +vector cstdlib vector cstring vector initializer_list vector iosfwd vector limits +vector locale vector new vector stdexcept +vector string +vector string_view vector tuple vector version diff --git a/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/types.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/types.compile.pass.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/types.compile.pass.cpp @@ -0,0 +1,39 @@ +//===----------------------------------------------------------------------===// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 +// UNSUPPORTED: libcpp-has-no-incomplete-format + +// + +// template requires is-vector-bool-reference +// struct formatter; + +// [format.formatter.spec]/4 +// If the library provides an explicit or partial specialization of +// formatter, that specialization is enabled and meets the +// Formatter requirements except as noted otherwise. +// +// Tests parts of the BasicFormatter requirements. Like the formattable concept +// it uses the semiregular concept. It test does not use the formattable +// concept since it is the intention the formatter is available without +// including the format header. + +// TODO FMT Evaluate what to do with [format.formatter.spec]/2 +// [format.formatter.spec]/2 +// Each header that declares the template formatter provides the following +// enabled specializations: +// Then there is a list of formatters, but is that really useful? +// Note this should be discussed in LEWG. + +#include +#include + +static_assert(std::semiregular::reference, char>>); +#ifndef TEST_HAS_NO_WIDE_CHARACTERS +static_assert(std::semiregular::reference, wchar_t>>); +#endif