[libc++] Don't skip localization-related headers in header tests (#134877)

When localization is disabled, we used to skip testing a lot of headers.
However, these headers are now "no-ops" when localization is disabled,
so they can actually be included. As such, we should test their
inclusion in our usual header inclusion tests.
This commit is contained in:
Louis Dionne
2025-06-10 14:12:46 -04:00
committed by GitHub
parent f993f362ef
commit baceb7923f
6 changed files with 38 additions and 100 deletions

View File

@@ -216,6 +216,11 @@ storage-class-specifier const error_category& iostream_category() noexcept;
#else
# include <__config>
// standard-mandated includes
// [ios.syn]
# include <iosfwd>
# if _LIBCPP_HAS_LOCALIZATION
# include <__fwd/ios.h>
@@ -230,11 +235,6 @@ storage-class-specifier const error_category& iostream_category() noexcept;
# include <__verbose_abort>
# include <version>
// standard-mandated includes
// [ios.syn]
# include <iosfwd>
# if _LIBCPP_HAS_ATOMIC_HEADER
# include <__atomic/atomic.h> // for __xindex_
# endif

View File

@@ -794,6 +794,19 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#else
# include <__config>
// standard-mandated includes
// [iterator.range]
# include <__iterator/access.h>
# include <__iterator/data.h>
# include <__iterator/empty.h>
# include <__iterator/reverse_access.h>
# include <__iterator/size.h>
// [re.syn]
# include <compare>
# include <initializer_list>
# if _LIBCPP_HAS_LOCALIZATION
# include <__algorithm/find.h>
@@ -817,19 +830,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
# include <vector>
# include <version>
// standard-mandated includes
// [iterator.range]
# include <__iterator/access.h>
# include <__iterator/data.h>
# include <__iterator/empty.h>
# include <__iterator/reverse_access.h>
# include <__iterator/size.h>
// [re.syn]
# include <compare>
# include <initializer_list>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

View File

@@ -122,6 +122,11 @@ namespace std {
#else
# include <__config>
// standard-mandated includes
// [syncstream.syn]
# include <ostream>
# if _LIBCPP_HAS_LOCALIZATION
# include <__mutex/lock_guard.h>
@@ -130,17 +135,11 @@ namespace std {
# include <iosfwd> // required for declaration of default arguments
# include <streambuf>
# include <string>
# if _LIBCPP_HAS_THREADS
# include <map>
# include <shared_mutex>
# endif
// standard-mandated includes
// [syncstream.syn]
# include <ostream>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif

View File

@@ -24,9 +24,7 @@ module;
#include <cfloat>
#include <cinttypes>
#include <climits>
#if _LIBCPP_HAS_LOCALIZATION
# include <clocale>
#endif
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>

View File

@@ -35,13 +35,9 @@ module;
#include <chrono>
#include <cinttypes>
#include <climits>
#if _LIBCPP_HAS_LOCALIZATION
# include <clocale>
#endif
#include <clocale>
#include <cmath>
#if _LIBCPP_HAS_LOCALIZATION
# include <codecvt>
#endif
#include <codecvt>
#include <compare>
#include <complex>
#include <concepts>
@@ -68,32 +64,20 @@ module;
#include <flat_set>
#include <format>
#include <forward_list>
#if _LIBCPP_HAS_LOCALIZATION
# include <fstream>
#endif
#include <fstream>
#include <functional>
#include <future>
#include <initializer_list>
#if _LIBCPP_HAS_LOCALIZATION
# include <iomanip>
#endif
#if _LIBCPP_HAS_LOCALIZATION
# include <ios>
#endif
#include <iomanip>
#include <ios>
#include <iosfwd>
#if _LIBCPP_HAS_LOCALIZATION
# include <iostream>
#endif
#if _LIBCPP_HAS_LOCALIZATION
# include <istream>
#endif
#include <iostream>
#include <istream>
#include <iterator>
#include <latch>
#include <limits>
#include <list>
#if _LIBCPP_HAS_LOCALIZATION
# include <locale>
#endif
#include <locale>
#include <map>
#include <mdspan>
#include <memory>
@@ -103,40 +87,28 @@ module;
#include <numbers>
#include <numeric>
#include <optional>
#if _LIBCPP_HAS_LOCALIZATION
# include <ostream>
#endif
#include <ostream>
#include <print>
#include <queue>
#include <random>
#include <ranges>
#include <ratio>
#if _LIBCPP_HAS_LOCALIZATION
# include <regex>
#endif
#include <regex>
#include <scoped_allocator>
#include <semaphore>
#include <set>
#include <shared_mutex>
#include <source_location>
#include <span>
#if _LIBCPP_HAS_LOCALIZATION
# include <sstream>
#endif
#include <sstream>
#include <stack>
#include <stdexcept>
#include <stop_token>
#if _LIBCPP_HAS_LOCALIZATION
# include <streambuf>
#endif
#include <streambuf>
#include <string>
#include <string_view>
#if _LIBCPP_HAS_LOCALIZATION
# include <strstream>
#endif
#if _LIBCPP_HAS_LOCALIZATION
# include <syncstream>
#endif
#include <strstream>
#include <syncstream>
#include <system_error>
#include <thread>
#include <tuple>

View File

@@ -179,29 +179,10 @@ header_restrictions = {
# headers with #error directives
"atomic": "_LIBCPP_HAS_ATOMIC_HEADER",
"stdatomic.h": "_LIBCPP_HAS_ATOMIC_HEADER",
# headers with #error directives
"ios": "_LIBCPP_HAS_LOCALIZATION",
# transitive includers of the above headers
"clocale": "_LIBCPP_HAS_LOCALIZATION",
"codecvt": "_LIBCPP_HAS_LOCALIZATION",
"fstream": "_LIBCPP_HAS_LOCALIZATION",
"iomanip": "_LIBCPP_HAS_LOCALIZATION",
"iostream": "_LIBCPP_HAS_LOCALIZATION",
"istream": "_LIBCPP_HAS_LOCALIZATION",
"locale": "_LIBCPP_HAS_LOCALIZATION",
"ostream": "_LIBCPP_HAS_LOCALIZATION",
"regex": "_LIBCPP_HAS_LOCALIZATION",
"sstream": "_LIBCPP_HAS_LOCALIZATION",
"streambuf": "_LIBCPP_HAS_LOCALIZATION",
"strstream": "_LIBCPP_HAS_LOCALIZATION",
"syncstream": "_LIBCPP_HAS_LOCALIZATION",
}
lit_header_restrictions = {
"barrier": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
"clocale": "// UNSUPPORTED: no-localization",
"codecvt": "// UNSUPPORTED: no-localization",
"coroutine": "// UNSUPPORTED: c++03, c++11, c++14, c++17",
"cwchar": "// UNSUPPORTED: no-wide-characters",
"cwctype": "// UNSUPPORTED: no-wide-characters",
@@ -211,26 +192,14 @@ lit_header_restrictions = {
"experimental/type_traits": "// UNSUPPORTED: c++03",
"experimental/utility": "// UNSUPPORTED: c++03",
"filesystem": "// UNSUPPORTED: no-filesystem, c++03, c++11, c++14",
"fstream": "// UNSUPPORTED: no-localization, no-filesystem",
"future": "// UNSUPPORTED: no-threads, c++03",
"iomanip": "// UNSUPPORTED: no-localization",
"ios": "// UNSUPPORTED: no-localization",
"iostream": "// UNSUPPORTED: no-localization",
"istream": "// UNSUPPORTED: no-localization",
"latch": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
"locale": "// UNSUPPORTED: no-localization",
"mutex": "// UNSUPPORTED: no-threads, c++03",
"ostream": "// UNSUPPORTED: no-localization",
"print": "// UNSUPPORTED: no-filesystem, c++03, c++11, c++14, c++17, c++20, availability-fp_to_chars-missing", # TODO PRINT investigate
"regex": "// UNSUPPORTED: no-localization",
"semaphore": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
"shared_mutex": "// UNSUPPORTED: no-threads, c++03, c++11",
"sstream": "// UNSUPPORTED: no-localization",
"stdatomic.h": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17, c++20",
"stop_token": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
"streambuf": "// UNSUPPORTED: no-localization",
"strstream": "// UNSUPPORTED: no-localization",
"syncstream": "// UNSUPPORTED: no-localization",
"thread": "// UNSUPPORTED: no-threads, c++03",
"wchar.h": "// UNSUPPORTED: no-wide-characters",
"wctype.h": "// UNSUPPORTED: no-wide-characters",