Skip to content

Commit f2da8e3

Browse files
committed
[libc++] Don't skip localization-related headers in header tests
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.
1 parent d05ab11 commit f2da8e3

File tree

4 files changed

+25
-57
lines changed

4 files changed

+25
-57
lines changed

libcxx/include/ios

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ storage-class-specifier const error_category& iostream_category() noexcept;
216216
#else
217217
# include <__config>
218218

219+
// standard-mandated includes
220+
221+
// [ios.syn]
222+
# include <iosfwd>
223+
219224
# if _LIBCPP_HAS_LOCALIZATION
220225

221226
# include <__fwd/ios.h>
@@ -230,11 +235,6 @@ storage-class-specifier const error_category& iostream_category() noexcept;
230235
# include <__verbose_abort>
231236
# include <version>
232237

233-
// standard-mandated includes
234-
235-
// [ios.syn]
236-
# include <iosfwd>
237-
238238
# if _LIBCPP_HAS_ATOMIC_HEADER
239239
# include <__atomic/atomic.h> // for __xindex_
240240
# endif

libcxx/include/regex

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,19 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
794794
#else
795795
# include <__config>
796796

797+
// standard-mandated includes
798+
799+
// [iterator.range]
800+
# include <__iterator/access.h>
801+
# include <__iterator/data.h>
802+
# include <__iterator/empty.h>
803+
# include <__iterator/reverse_access.h>
804+
# include <__iterator/size.h>
805+
806+
// [re.syn]
807+
# include <compare>
808+
# include <initializer_list>
809+
797810
# if _LIBCPP_HAS_LOCALIZATION
798811

799812
# include <__algorithm/find.h>
@@ -817,19 +830,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
817830
# include <vector>
818831
# include <version>
819832

820-
// standard-mandated includes
821-
822-
// [iterator.range]
823-
# include <__iterator/access.h>
824-
# include <__iterator/data.h>
825-
# include <__iterator/empty.h>
826-
# include <__iterator/reverse_access.h>
827-
# include <__iterator/size.h>
828-
829-
// [re.syn]
830-
# include <compare>
831-
# include <initializer_list>
832-
833833
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
834834
# pragma GCC system_header
835835
# endif
@@ -5336,8 +5336,8 @@ typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
53365336

53375337
template <class _BidirectionalIterator, class _CharT, class _Traits>
53385338
class _LIBCPP_PREFERRED_NAME(cregex_iterator) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcregex_iterator))
5339-
_LIBCPP_PREFERRED_NAME(sregex_iterator)
5340-
_LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsregex_iterator)) regex_iterator {
5339+
_LIBCPP_PREFERRED_NAME(sregex_iterator) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsregex_iterator))
5340+
regex_iterator {
53415341
public:
53425342
typedef basic_regex<_CharT, _Traits> regex_type;
53435343
typedef match_results<_BidirectionalIterator> value_type;

libcxx/include/syncstream

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ namespace std {
122122
#else
123123
# include <__config>
124124

125+
// standard-mandated includes
126+
127+
// [syncstream.syn]
128+
# include <ostream>
129+
125130
# if _LIBCPP_HAS_LOCALIZATION
126131

127132
# include <__mutex/lock_guard.h>
@@ -130,17 +135,11 @@ namespace std {
130135
# include <iosfwd> // required for declaration of default arguments
131136
# include <streambuf>
132137
# include <string>
133-
134138
# if _LIBCPP_HAS_THREADS
135139
# include <map>
136140
# include <shared_mutex>
137141
# endif
138142

139-
// standard-mandated includes
140-
141-
// [syncstream.syn]
142-
# include <ostream>
143-
144143
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
145144
# pragma GCC system_header
146145
# endif

libcxx/utils/libcxx/header_information.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -179,29 +179,10 @@ def __hash__(self) -> int:
179179
# headers with #error directives
180180
"atomic": "_LIBCPP_HAS_ATOMIC_HEADER",
181181
"stdatomic.h": "_LIBCPP_HAS_ATOMIC_HEADER",
182-
183-
# headers with #error directives
184-
"ios": "_LIBCPP_HAS_LOCALIZATION",
185-
# transitive includers of the above headers
186-
"clocale": "_LIBCPP_HAS_LOCALIZATION",
187-
"codecvt": "_LIBCPP_HAS_LOCALIZATION",
188-
"fstream": "_LIBCPP_HAS_LOCALIZATION",
189-
"iomanip": "_LIBCPP_HAS_LOCALIZATION",
190-
"iostream": "_LIBCPP_HAS_LOCALIZATION",
191-
"istream": "_LIBCPP_HAS_LOCALIZATION",
192-
"locale": "_LIBCPP_HAS_LOCALIZATION",
193-
"ostream": "_LIBCPP_HAS_LOCALIZATION",
194-
"regex": "_LIBCPP_HAS_LOCALIZATION",
195-
"sstream": "_LIBCPP_HAS_LOCALIZATION",
196-
"streambuf": "_LIBCPP_HAS_LOCALIZATION",
197-
"strstream": "_LIBCPP_HAS_LOCALIZATION",
198-
"syncstream": "_LIBCPP_HAS_LOCALIZATION",
199182
}
200183

201184
lit_header_restrictions = {
202185
"barrier": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
203-
"clocale": "// UNSUPPORTED: no-localization",
204-
"codecvt": "// UNSUPPORTED: no-localization",
205186
"coroutine": "// UNSUPPORTED: c++03, c++11, c++14, c++17",
206187
"cwchar": "// UNSUPPORTED: no-wide-characters",
207188
"cwctype": "// UNSUPPORTED: no-wide-characters",
@@ -211,26 +192,14 @@ def __hash__(self) -> int:
211192
"experimental/type_traits": "// UNSUPPORTED: c++03",
212193
"experimental/utility": "// UNSUPPORTED: c++03",
213194
"filesystem": "// UNSUPPORTED: no-filesystem, c++03, c++11, c++14",
214-
"fstream": "// UNSUPPORTED: no-localization, no-filesystem",
215195
"future": "// UNSUPPORTED: no-threads, c++03",
216-
"iomanip": "// UNSUPPORTED: no-localization",
217-
"ios": "// UNSUPPORTED: no-localization",
218-
"iostream": "// UNSUPPORTED: no-localization",
219-
"istream": "// UNSUPPORTED: no-localization",
220196
"latch": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
221-
"locale": "// UNSUPPORTED: no-localization",
222197
"mutex": "// UNSUPPORTED: no-threads, c++03",
223-
"ostream": "// UNSUPPORTED: no-localization",
224198
"print": "// UNSUPPORTED: no-filesystem, c++03, c++11, c++14, c++17, c++20, availability-fp_to_chars-missing", # TODO PRINT investigate
225-
"regex": "// UNSUPPORTED: no-localization",
226199
"semaphore": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
227200
"shared_mutex": "// UNSUPPORTED: no-threads, c++03, c++11",
228-
"sstream": "// UNSUPPORTED: no-localization",
229201
"stdatomic.h": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17, c++20",
230202
"stop_token": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
231-
"streambuf": "// UNSUPPORTED: no-localization",
232-
"strstream": "// UNSUPPORTED: no-localization",
233-
"syncstream": "// UNSUPPORTED: no-localization",
234203
"thread": "// UNSUPPORTED: no-threads, c++03",
235204
"wchar.h": "// UNSUPPORTED: no-wide-characters",
236205
"wctype.h": "// UNSUPPORTED: no-wide-characters",

0 commit comments

Comments
 (0)