File tree 3 files changed +27
-3
lines changed 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -138,9 +138,6 @@ export namespace std {
138
138
}
139
139
#endif // _LIBCPP_HAS_NO_LOCALIZATION
140
140
141
- #if _LIBCPP_STD_VER >= 23
142
- // [range.adaptor.object], range adaptor objects
143
- using std::ranges::range_adaptor_closure;
144
141
// Note: This declaration not in the synopsis or explicitly in the wording.
145
142
// However it is needed for the range adaptors.
146
143
// [range.adaptor.object]/3
@@ -151,7 +148,11 @@ export namespace std {
151
148
// involving an object of type cv D as an operand to the | operator is
152
149
// undefined if overload resolution selects a program-defined operator|
153
150
// function.
151
+ // This is used internally in C++20 mode.
154
152
using std::ranges::operator |;
153
+ #if _LIBCPP_STD_VER >= 23
154
+ // [range.adaptor.object], range adaptor objects
155
+ using std::ranges::range_adaptor_closure;
155
156
#endif
156
157
157
158
// [range.all], all view
Original file line number Diff line number Diff line change 24
24
// The GCC compiler flags are not always compatible with clang-tidy.
25
25
// UNSUPPORTED{ BLOCKLIT } : gcc
26
26
27
+ // Clang 17 has false positives.
28
+ // UNSUPPORTED{ BLOCKLIT } : clang-17
29
+
27
30
{ lit_header_restrictions .get (header , '' )}
28
31
29
32
// TODO: run clang-tidy with modules enabled once they are supported
Original file line number Diff line number Diff line change @@ -64,6 +64,26 @@ if(NOT HAS_CLANG_TIDY_HEADERS)
64
64
"clang-tidy headers are not present." )
65
65
return ()
66
66
endif ()
67
+
68
+ # The clangTidy plugin uses C++20, when using stdlibc++ verify the version is correct.
69
+ # Note it has not been tested whether version 11 works.
70
+ file (WRITE "${CMAKE_CURRENT_BINARY_DIR} /test.cpp" "
71
+ #include <version>
72
+ #if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 12
73
+ # error The stdlibc++ version is too old.
74
+ #endif
75
+ int main(){}
76
+ " )
77
+ try_compile (HAS_NEWER_STANDARD_LIBRARY
78
+ "${CMAKE_CURRENT_BINARY_DIR} "
79
+ "${CMAKE_CURRENT_BINARY_DIR} /test.cpp"
80
+ LINK_LIBRARIES clangTidy)
81
+
82
+ if (NOT HAS_NEWER_STANDARD_LIBRARY)
83
+ message (STATUS "Clang-tidy tests are disabled due to using "
84
+ "stdlibc++ older than version 12" )
85
+ return ()
86
+ endif ()
67
87
message (STATUS "Clang-tidy tests are enabled." )
68
88
69
89
set (SOURCES
You can’t perform that action at this time.
0 commit comments