[libcxx-commits] [libcxx] [libc++][test] Enhance `ADDITIONAL_COMPILE_FLAGS` to work with MSVC (PR #74974)
Stephan T. Lavavej via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Dec 11 14:15:56 PST 2023
https://github.com/StephanTLavavej updated https://github.com/llvm/llvm-project/pull/74974
>From e37385902de4323ad6fcc18f4f4d4cfe582a5c02 Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Tue, 28 Nov 2023 17:37:49 -0800
Subject: [PATCH 01/13] Use the verify-support feature.
---
.../atomics/atomics.types.generic/trivially_copyable.verify.cpp | 2 +-
.../std/containers/views/views.span/span.sub/subspan.verify.cpp | 2 +-
.../any/any.nonmembers/any.cast/const_correctness.verify.cpp | 2 +-
.../any.nonmembers/any.cast/not_copy_constructible.verify.cpp | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp b/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
index 0955707cdcf38..80e77048ecd85 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
@@ -15,7 +15,7 @@
// is not trivially copyable, however Clang will sometimes emit additional
// errors while trying to instantiate the rest of std::atomic<T>.
// We silence those to make the test more robust.
-// ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=error
+// ADDITIONAL_COMPILE_FLAGS(verify-support): -Xclang -verify-ignore-unexpected=error
#include <atomic>
diff --git a/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp b/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp
index d6bc21197098a..eb881707b1e64 100644
--- a/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp
@@ -9,7 +9,7 @@
// This test also generates spurious warnings when instantiating std::span
// with a very large extent (like size_t(-2)) -- silence those.
-// ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=warning
+// ADDITIONAL_COMPILE_FLAGS(verify-support): -Xclang -verify-ignore-unexpected=warning
// <span>
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
index 1830626d7f410..04cae7801c565 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
@@ -20,7 +20,7 @@
// additional errors while trying to instantiate the rest of any_cast
// following the static_assert. We ignore unexpected errors in
// clang-verify to make the test more robust to changes in Clang.
-// ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=error
+// ADDITIONAL_COMPILE_FLAGS(verify-support): -Xclang -verify-ignore-unexpected=error
#include <any>
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
index 3b9aac581a083..5aaca89e9e679 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
@@ -26,7 +26,7 @@
// additional errors while trying to instantiate the rest of any_cast
// following the static_assert. We ignore unexpected errors in
// clang-verify to make the test more robust to changes in Clang.
-// ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=error
+// ADDITIONAL_COMPILE_FLAGS(verify-support): -Xclang -verify-ignore-unexpected=error
#include <any>
>From 4cc6dc0d187ae306f95635bbc7b88f3747e2fcfe Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Wed, 29 Nov 2023 11:48:00 -0800
Subject: [PATCH 02/13] Add a new feature any-clang-or-gcc.
---
.../std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp | 2 +-
.../std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp | 2 +-
.../algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp | 2 +-
.../default_initializable.compile.pass.cpp | 2 +-
.../associative/map/map.modifiers/insert_range.pass.cpp | 2 +-
.../multimap/multimap.modifiers/insert_range.pass.cpp | 2 +-
.../std/containers/associative/multiset/insert_range.pass.cpp | 2 +-
.../test/std/containers/associative/set/insert_range.pass.cpp | 2 +-
.../std/containers/sequences/array/array.tuple/get.verify.cpp | 2 +-
.../unord/unord.map/unord.map.modifiers/insert_range.pass.cpp | 2 +-
.../unord.multimap.modifiers/insert_range.pass.cpp | 2 +-
.../std/containers/unord/unord.multiset/insert_range.pass.cpp | 2 +-
.../test/std/containers/unord/unord.set/insert_range.pass.cpp | 2 +-
.../containers/views/mdspan/layout_stride/deduction.pass.cpp | 2 +-
.../depr/depr.numeric.limits.has.denorm/deprecated.verify.cpp | 2 +-
.../basic.string/string.cons/from_range_deduction.pass.cpp | 2 +-
libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp | 2 +-
.../meta/meta.unary/dependent_return_type.compile.pass.cpp | 2 +-
.../unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp | 2 +-
.../utilities/variant/variant.variant/implicit_ctad.pass.cpp | 2 +-
libcxx/utils/libcxx/test/features.py | 3 +++
21 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
index e28cbe2a08de4..e79bab5df379e 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
@@ -19,7 +19,7 @@
// equal(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2);
// We test the cartesian product, so we sometimes compare differently signed types
-// ADDITIONAL_COMPILE_FLAGS: -Wno-sign-compare
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-sign-compare
#include <algorithm>
#include <cassert>
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
index b55a852c10caf..7853d7b528453 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS: -Wno-sign-compare
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-sign-compare
// <algorithm>
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp
index 22f938f73ae07..e4e2eb7117307 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp
@@ -10,7 +10,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// ADDITIONAL_COMPILE_FLAGS: -Wno-sign-compare
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-sign-compare
// template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
// requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
diff --git a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
index 4921a48bcccc1..87c3ed0f8803d 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
@@ -10,7 +10,7 @@
// We voluntarily use std::default_initializable on types that have redundant
// or ignored cv-qualifiers -- don't warn about it.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-ignored-qualifiers
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-ignored-qualifiers
// template<class T>
// concept default_initializable = constructible_from<T> &&
diff --git a/libcxx/test/std/containers/associative/map/map.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/associative/map/map.modifiers/insert_range.pass.cpp
index 1d7fe7193facf..6f1c638840853 100644
--- a/libcxx/test/std/containers/associative/map/map.modifiers/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.modifiers/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
// <map>
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_range.pass.cpp
index c7c05a896bc9f..c9d259d03efe8 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
// <map>
diff --git a/libcxx/test/std/containers/associative/multiset/insert_range.pass.cpp b/libcxx/test/std/containers/associative/multiset/insert_range.pass.cpp
index 9dd85eea47c29..eb125f1520ec1 100644
--- a/libcxx/test/std/containers/associative/multiset/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
// <set>
diff --git a/libcxx/test/std/containers/associative/set/insert_range.pass.cpp b/libcxx/test/std/containers/associative/set/insert_range.pass.cpp
index 1956fc6bd7f3e..1ae7f7d5cd16e 100644
--- a/libcxx/test/std/containers/associative/set/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
// <set>
diff --git a/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp b/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
index 9052b4359f6b0..c93ea75c221da 100644
--- a/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
@@ -11,7 +11,7 @@
// template <size_t I, class T, size_t N> T& get(array<T, N>& a);
// Prevent -Warray-bounds from issuing a diagnostic when testing with clang verify.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-array-bounds
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-array-bounds
#include <array>
#include <cassert>
diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp
index 8b004336f68cd..f524273bdda03 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
// <unordered_map>
diff --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp
index fcde119f48703..7219225ff16d9 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
// <unordered_map>
diff --git a/libcxx/test/std/containers/unord/unord.multiset/insert_range.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/insert_range.pass.cpp
index 73ac4cf071e1b..119091c007cb0 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
// <set>
diff --git a/libcxx/test/std/containers/unord/unord.set/insert_range.pass.cpp b/libcxx/test/std/containers/unord/unord.set/insert_range.pass.cpp
index c6306a28b7adb..d9503808c7f2c 100644
--- a/libcxx/test/std/containers/unord/unord.set/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
// <set>
diff --git a/libcxx/test/std/containers/views/mdspan/layout_stride/deduction.pass.cpp b/libcxx/test/std/containers/views/mdspan/layout_stride/deduction.pass.cpp
index 0e0a079b598bc..5384f37fd40c7 100644
--- a/libcxx/test/std/containers/views/mdspan/layout_stride/deduction.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/layout_stride/deduction.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// ADDITIONAL_COMPILE_FLAGS: -Wno-ctad-maybe-unsupported
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-ctad-maybe-unsupported
// <mdspan>
diff --git a/libcxx/test/std/depr/depr.numeric.limits.has.denorm/deprecated.verify.cpp b/libcxx/test/std/depr/depr.numeric.limits.has.denorm/deprecated.verify.cpp
index 98d49de80a58c..9aa0d0b21d1e0 100644
--- a/libcxx/test/std/depr/depr.numeric.limits.has.denorm/deprecated.verify.cpp
+++ b/libcxx/test/std/depr/depr.numeric.limits.has.denorm/deprecated.verify.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// ADDITIONAL_COMPILE_FLAGS: -Wno-unused-value
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-unused-value
#include <limits>
diff --git a/libcxx/test/std/strings/basic.string/string.cons/from_range_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/from_range_deduction.pass.cpp
index b2dab03506f03..698f6d834f860 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/from_range_deduction.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/from_range_deduction.pass.cpp
@@ -10,7 +10,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// To silence a GCC warning-turned-error re. `BadAlloc::value_type`.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-unused-local-typedefs
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-unused-local-typedefs
// template<ranges::input_range R,
// class Allocator = allocator<ranges::range_value_t<R>>>
diff --git a/libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp b/libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp
index 89521ad7660a1..cb92e02faa4f2 100644
--- a/libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp
+++ b/libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp
@@ -10,7 +10,7 @@
// UNSUPPORTED: libcpp-has-no-experimental-stop_token
// UNSUPPORTED: c++03, c++11, c++14, c++17
// XFAIL: availability-synchronization_library-missing
-// ADDITIONAL_COMPILE_FLAGS: -Wno-self-move
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-self-move
// jthread& operator=(jthread&&) noexcept;
diff --git a/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp
index b382940423e05..390cb1ca6a435 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp
@@ -11,7 +11,7 @@
// UNSUPPORTED: c++03, c++11
// ignore deprecated volatile return types
-// ADDITIONAL_COMPILE_FLAGS: -Wno-deprecated-volatile
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-deprecated-volatile
#include <type_traits>
#include <utility>
diff --git a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp
index 80d75e721e52e..1c87019b9ea67 100644
--- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp
+++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03
// Self assignment post-conditions are tested.
-// ADDITIONAL_COMPILE_FLAGS: -Wno-self-move
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-self-move
// <memory>
diff --git a/libcxx/test/std/utilities/variant/variant.variant/implicit_ctad.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/implicit_ctad.pass.cpp
index 514c1f87faad0..b090291aeba48 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/implicit_ctad.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/implicit_ctad.pass.cpp
@@ -17,7 +17,7 @@
// We make sure that it is not ill-formed, however we still produce a warning for
// this one because explicit construction from a variant using CTAD is ambiguous
// (in the sense that the programer intent is not clear).
-// ADDITIONAL_COMPILE_FLAGS: -Wno-ctad-maybe-unsupported
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-ctad-maybe-unsupported
#include <variant>
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 5e854917e6ef4..2e553dc45b637 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -61,6 +61,9 @@ def _getAndroidDeviceApi(cfg):
# Lit features are evaluated in order. Some checks may require the compiler detection to have
# run first in order to work properly.
DEFAULT_FEATURES = [
+ # This detects compilers that understand the -Wno-meow family of flags, unlike MSVC's compiler driver cl.exe.
+ Feature(name="any-clang-or-gcc", when=_isAppleClang or _isClang or _isGCC),
+
Feature(name="apple-clang", when=_isAppleClang),
Feature(
name=lambda cfg: "apple-clang-{__clang_major__}".format(**compilerMacros(cfg)),
>From 7f2db6292732214c887eb127c20d75ac356b5b7b Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Sat, 2 Dec 2023 16:13:46 -0800
Subject: [PATCH 03/13] Add ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc).
---
.../range.lazy.split/constraints.compile.pass.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
index a942f43904092..2a772ccb83f81 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
@@ -8,6 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// This is a compile-only test, so "inline function is not defined" warnings are irrelevant.
+// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-undefined-inline
+
// template<input_range V, forward_range Pattern>
// requires view<V> && view<Pattern> &&
// indirectly_comparable<iterator_t<V>, iterator_t<Pattern>, ranges::equal_to> &&
>From ee4b92594c82b8290822562b56834889cccfc9ed Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Wed, 29 Nov 2023 20:16:10 -0800
Subject: [PATCH 04/13] Add ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe).
---
.../alg.replace/ranges.replace.pass.cpp | 3 +++
.../std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp | 5 +++++
.../std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp | 2 ++
.../alg.nonmodifying/alg.find/ranges.find.pass.cpp | 3 +++
.../atomics/atomics.types.generic/general.compile.pass.cpp | 3 +++
.../atomics/atomics.types.generic/pointer.compile.pass.cpp | 3 +++
.../std/containers/views/mdspan/mdspan/conversion.pass.cpp | 3 +++
.../test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp | 3 +++
.../std/language.support/support.runtime/csetjmp.pass.cpp | 3 +++
.../std/ranges/range.utility/range.utility.conv/to.pass.cpp | 3 +++
.../notify_all_at_thread_exit_lwg3343.pass.cpp | 3 +++
.../meta/meta.unary/dependent_return_type.compile.pass.cpp | 2 ++
12 files changed, 36 insertions(+)
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp
index ab2f705bafe9d..32da9345c97e1 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// MSVC warning C4244: 'argument': conversion from 'const _Ty2' to 'T', possible loss of data
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4244
+
// <algorithm>
// UNSUPPORTED: c++03, c++11, c++14, c++17
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
index e79bab5df379e..93ca4827a6e54 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
@@ -20,6 +20,11 @@
// We test the cartesian product, so we sometimes compare differently signed types
// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-sign-compare
+// MSVC warning C4242: 'argument': conversion from 'int' to 'const _Ty', possible loss of data
+// MSVC warning C4244: 'argument': conversion from 'wchar_t' to 'const _Ty', possible loss of data
+// MSVC warning C4310: cast truncates constant value
+// MSVC warning C4389: '==': signed/unsigned mismatch
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4242 /wd4244 /wd4310 /wd4389
#include <algorithm>
#include <cassert>
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
index 7853d7b528453..64fcf9976f772 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-sign-compare
+// MSVC warning C4389: '==': signed/unsigned mismatch
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4389
// <algorithm>
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp
index e4e2eb7117307..3b60495b6667d 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp
@@ -11,6 +11,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-sign-compare
+// MSVC warning C4242: 'argument': conversion from 'const _Ty' to 'ElementT', possible loss of data
+// MSVC warning C4244: 'argument': conversion from 'const _Ty' to 'ElementT', possible loss of data
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4242 /wd4244
// template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
// requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
diff --git a/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp
index 9f2a28256184c..c43c2e5ac9537 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// MSVC warning C4197: 'volatile std::atomic<operator_hijacker>': top-level volatile in cast is ignored
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4197
+
// UNSUPPORTED: c++03
// XFAIL: availability-synchronization_library-missing
diff --git a/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp
index 9049beaa9c789..acc5464e5f690 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// MSVC warning C4197: 'volatile std::atomic<operator_hijacker *>': top-level volatile in cast is ignored
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4197
+
// UNSUPPORTED: c++03
// XFAIL: availability-synchronization_library-missing
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/conversion.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/conversion.pass.cpp
index abb647e960c34..99d786d1d33f5 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/conversion.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/conversion.pass.cpp
@@ -7,6 +7,9 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+// MSVC warning C4244: 'initializing': conversion from '_Ty' to '_Ty', possible loss of data
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4244
+
// <mdspan>
// template<class OtherElementType, class OtherExtents,
diff --git a/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
index eaaeecbeb70ec..feeefc1194e85 100644
--- a/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// MSVC warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4611
+
// test <setjmp.h>
//
// Even though <setjmp.h> is not provided by libc++, we still test that
diff --git a/libcxx/test/std/language.support/support.runtime/csetjmp.pass.cpp b/libcxx/test/std/language.support/support.runtime/csetjmp.pass.cpp
index d6d32c371b9e5..c95ebcf8c4b9d 100644
--- a/libcxx/test/std/language.support/support.runtime/csetjmp.pass.cpp
+++ b/libcxx/test/std/language.support/support.runtime/csetjmp.pass.cpp
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// MSVC warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4611
+
// test <csetjmp>
#include <csetjmp>
diff --git a/libcxx/test/std/ranges/range.utility/range.utility.conv/to.pass.cpp b/libcxx/test/std/ranges/range.utility/range.utility.conv/to.pass.cpp
index 03270f25fd92b..719e6e818b68e 100644
--- a/libcxx/test/std/ranges/range.utility/range.utility.conv/to.pass.cpp
+++ b/libcxx/test/std/ranges/range.utility/range.utility.conv/to.pass.cpp
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
+// MSVC warning C4244: 'argument': conversion from '_Ty' to 'int', possible loss of data
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4244
+
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// template<class C, input_range R, class... Args> requires (!view<C>)
diff --git a/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp b/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp
index ffb632a5149b5..992ff4a6cfadf 100644
--- a/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp
+++ b/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp
@@ -17,6 +17,9 @@
// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{.+}}
// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx11.{{.+}}
+// MSVC warning C4583: 'X::cv_': destructor is not implicitly called
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4583
+
// This is a regression test for LWG3343.
//
// <condition_variable>
diff --git a/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp
index 390cb1ca6a435..22b718bfcadc9 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp
@@ -12,6 +12,8 @@
// ignore deprecated volatile return types
// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-deprecated-volatile
+// MSVC warning C5216: 'volatile int' a volatile qualified return type is deprecated in C++20
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd5216
#include <type_traits>
#include <utility>
>From d99d3117dd818618f7af794bf35fdcd3cb06d619 Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Fri, 8 Dec 2023 14:27:39 -0800
Subject: [PATCH 05/13] Add ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe) to silence a
blizzard of x86 truncation warnings.
---
.../fstreams/ifstream.members/buffered_reads.pass.cpp | 3 +++
.../fstreams/ofstream.members/buffered_writes.pass.cpp | 3 +++
2 files changed, 6 insertions(+)
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
index d57b7c20a2da2..e6a6b650800b6 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
@@ -7,6 +7,9 @@
//===----------------------------------------------------------------------===//
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
+// MSVC warning C4242: '+=': conversion from 'const _Ty' to 'size_t', possible loss of data
+// MSVC warning C4244: 'argument': conversion from 'std::streamsize' to 'size_t', possible loss of data
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4242 /wd4244
// UNSUPPORTED: c++03
// <fstream>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
index e782073950510..697ea7233de49 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
@@ -7,6 +7,9 @@
//===----------------------------------------------------------------------===//
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
+// MSVC warning C4242: '+=': conversion from 'const _Ty' to 'size_t', possible loss of data
+// MSVC warning C4244: 'argument': conversion from 'std::streamsize' to 'size_t', possible loss of data
+// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4242 /wd4244
// UNSUPPORTED: c++03
// <fstream>
>From e03cce124e10e8a0e61a184dfc2ff61112755e49 Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Sat, 9 Dec 2023 22:23:07 -0800
Subject: [PATCH 06/13] Apply Python formatting from CI.
---
libcxx/utils/libcxx/test/features.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 2e553dc45b637..8533d34001a01 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -63,7 +63,6 @@ def _getAndroidDeviceApi(cfg):
DEFAULT_FEATURES = [
# This detects compilers that understand the -Wno-meow family of flags, unlike MSVC's compiler driver cl.exe.
Feature(name="any-clang-or-gcc", when=_isAppleClang or _isClang or _isGCC),
-
Feature(name="apple-clang", when=_isAppleClang),
Feature(
name=lambda cfg: "apple-clang-{__clang_major__}".format(**compilerMacros(cfg)),
>From d26721cc2aab425bb6e91110bb38ade78a2bdf43 Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Sun, 10 Dec 2023 01:35:03 -0800
Subject: [PATCH 07/13] Properly implement `_isAnyClangOrGCC`.
---
libcxx/utils/libcxx/test/features.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 8533d34001a01..6c689c579b7f0 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -13,6 +13,7 @@
import subprocess
import sys
+_isAnyClangOrGCC = lambda cfg: "__clang__" in compilerMacros(cfg) or "__GNUC__" in compilerMacros(cfg)
_isClang = lambda cfg: "__clang__" in compilerMacros(cfg) and "__apple_build_version__" not in compilerMacros(cfg)
_isAppleClang = lambda cfg: "__apple_build_version__" in compilerMacros(cfg)
_isGCC = lambda cfg: "__GNUC__" in compilerMacros(cfg) and "__clang__" not in compilerMacros(cfg)
@@ -61,8 +62,8 @@ def _getAndroidDeviceApi(cfg):
# Lit features are evaluated in order. Some checks may require the compiler detection to have
# run first in order to work properly.
DEFAULT_FEATURES = [
- # This detects compilers that understand the -Wno-meow family of flags, unlike MSVC's compiler driver cl.exe.
- Feature(name="any-clang-or-gcc", when=_isAppleClang or _isClang or _isGCC),
+ # any-clang-or-gcc detects compilers that understand -Wno-meow flags, unlike MSVC's compiler driver cl.exe.
+ Feature(name="any-clang-or-gcc", when=_isAnyClangOrGCC),
Feature(name="apple-clang", when=_isAppleClang),
Feature(
name=lambda cfg: "apple-clang-{__clang_major__}".format(**compilerMacros(cfg)),
>From fe3cb7293da4ec4ad6c604a542ed297a08821987 Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Sun, 10 Dec 2023 01:44:30 -0800
Subject: [PATCH 08/13] Apply Python diff from CI.
---
libcxx/utils/libcxx/test/features.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 6c689c579b7f0..ebfc5b7fced8c 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -13,8 +13,12 @@
import subprocess
import sys
-_isAnyClangOrGCC = lambda cfg: "__clang__" in compilerMacros(cfg) or "__GNUC__" in compilerMacros(cfg)
-_isClang = lambda cfg: "__clang__" in compilerMacros(cfg) and "__apple_build_version__" not in compilerMacros(cfg)
+_isAnyClangOrGCC = lambda cfg: "__clang__" in compilerMacros(
+ cfg
+) or "__GNUC__" in compilerMacros(cfg)
+_isClang = lambda cfg: "__clang__" in compilerMacros(
+ cfg
+) and "__apple_build_version__" not in compilerMacros(cfg)
_isAppleClang = lambda cfg: "__apple_build_version__" in compilerMacros(cfg)
_isGCC = lambda cfg: "__GNUC__" in compilerMacros(cfg) and "__clang__" not in compilerMacros(cfg)
_isMSVC = lambda cfg: "_MSC_VER" in compilerMacros(cfg)
>From 9b7c957321869edffe47744e20331f65053397ae Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Sun, 10 Dec 2023 03:34:42 -0800
Subject: [PATCH 09/13] Revert "Use the verify-support feature."
This reverts commit e37385902de4323ad6fcc18f4f4d4cfe582a5c02.
---
.../atomics/atomics.types.generic/trivially_copyable.verify.cpp | 2 +-
.../std/containers/views/views.span/span.sub/subspan.verify.cpp | 2 +-
.../any/any.nonmembers/any.cast/const_correctness.verify.cpp | 2 +-
.../any.nonmembers/any.cast/not_copy_constructible.verify.cpp | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp b/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
index 80e77048ecd85..0955707cdcf38 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.verify.cpp
@@ -15,7 +15,7 @@
// is not trivially copyable, however Clang will sometimes emit additional
// errors while trying to instantiate the rest of std::atomic<T>.
// We silence those to make the test more robust.
-// ADDITIONAL_COMPILE_FLAGS(verify-support): -Xclang -verify-ignore-unexpected=error
+// ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=error
#include <atomic>
diff --git a/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp b/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp
index eb881707b1e64..d6bc21197098a 100644
--- a/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.sub/subspan.verify.cpp
@@ -9,7 +9,7 @@
// This test also generates spurious warnings when instantiating std::span
// with a very large extent (like size_t(-2)) -- silence those.
-// ADDITIONAL_COMPILE_FLAGS(verify-support): -Xclang -verify-ignore-unexpected=warning
+// ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=warning
// <span>
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
index 04cae7801c565..1830626d7f410 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
@@ -20,7 +20,7 @@
// additional errors while trying to instantiate the rest of any_cast
// following the static_assert. We ignore unexpected errors in
// clang-verify to make the test more robust to changes in Clang.
-// ADDITIONAL_COMPILE_FLAGS(verify-support): -Xclang -verify-ignore-unexpected=error
+// ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=error
#include <any>
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
index 5aaca89e9e679..3b9aac581a083 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
@@ -26,7 +26,7 @@
// additional errors while trying to instantiate the rest of any_cast
// following the static_assert. We ignore unexpected errors in
// clang-verify to make the test more robust to changes in Clang.
-// ADDITIONAL_COMPILE_FLAGS(verify-support): -Xclang -verify-ignore-unexpected=error
+// ADDITIONAL_COMPILE_FLAGS: -Xclang -verify-ignore-unexpected=error
#include <any>
>From 6f54569a1d43309665ff371228b19eab26de5d2f Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Sun, 10 Dec 2023 04:16:06 -0800
Subject: [PATCH 10/13] Rename `any-clang-or-gcc` => `gcc-style-warnings`,
`msvc-cl-exe` => `cl-style-warnings`.
I've left `_isAnyClangOrGCC` unchanged, since that's what it's physically checking for.
---
.../alg.replace/ranges.replace.pass.cpp | 2 +-
.../std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp | 4 ++--
.../std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp | 4 ++--
.../algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp | 4 ++--
.../atomics/atomics.types.generic/general.compile.pass.cpp | 2 +-
.../atomics/atomics.types.generic/pointer.compile.pass.cpp | 2 +-
.../default_initializable.compile.pass.cpp | 2 +-
.../associative/map/map.modifiers/insert_range.pass.cpp | 2 +-
.../multimap/multimap.modifiers/insert_range.pass.cpp | 2 +-
.../std/containers/associative/multiset/insert_range.pass.cpp | 2 +-
.../test/std/containers/associative/set/insert_range.pass.cpp | 2 +-
.../std/containers/sequences/array/array.tuple/get.verify.cpp | 2 +-
.../unord/unord.map/unord.map.modifiers/insert_range.pass.cpp | 2 +-
.../unord.multimap.modifiers/insert_range.pass.cpp | 2 +-
.../std/containers/unord/unord.multiset/insert_range.pass.cpp | 2 +-
.../test/std/containers/unord/unord.set/insert_range.pass.cpp | 2 +-
.../containers/views/mdspan/layout_stride/deduction.pass.cpp | 2 +-
.../std/containers/views/mdspan/mdspan/conversion.pass.cpp | 2 +-
libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp | 2 +-
.../depr/depr.numeric.limits.has.denorm/deprecated.verify.cpp | 2 +-
.../fstreams/ifstream.members/buffered_reads.pass.cpp | 2 +-
.../fstreams/ofstream.members/buffered_writes.pass.cpp | 2 +-
.../std/language.support/support.runtime/csetjmp.pass.cpp | 2 +-
.../range.lazy.split/constraints.compile.pass.cpp | 2 +-
.../std/ranges/range.utility/range.utility.conv/to.pass.cpp | 2 +-
.../basic.string/string.cons/from_range_deduction.pass.cpp | 2 +-
.../notify_all_at_thread_exit_lwg3343.pass.cpp | 2 +-
libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp | 2 +-
.../meta/meta.unary/dependent_return_type.compile.pass.cpp | 4 ++--
.../unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp | 2 +-
.../utilities/variant/variant.variant/implicit_ctad.pass.cpp | 2 +-
libcxx/utils/libcxx/test/features.py | 4 ++--
32 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp
index 32da9345c97e1..16834782914b5 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// MSVC warning C4244: 'argument': conversion from 'const _Ty2' to 'T', possible loss of data
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4244
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4244
// <algorithm>
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
index 93ca4827a6e54..abfb7fb34ddec 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
@@ -19,12 +19,12 @@
// equal(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2);
// We test the cartesian product, so we sometimes compare differently signed types
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-sign-compare
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-sign-compare
// MSVC warning C4242: 'argument': conversion from 'int' to 'const _Ty', possible loss of data
// MSVC warning C4244: 'argument': conversion from 'wchar_t' to 'const _Ty', possible loss of data
// MSVC warning C4310: cast truncates constant value
// MSVC warning C4389: '==': signed/unsigned mismatch
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4242 /wd4244 /wd4310 /wd4389
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4242 /wd4244 /wd4310 /wd4389
#include <algorithm>
#include <cassert>
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
index 64fcf9976f772..3141f1431fcc1 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-sign-compare
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-sign-compare
// MSVC warning C4389: '==': signed/unsigned mismatch
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4389
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4389
// <algorithm>
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp
index 3b60495b6667d..dbb58749a567e 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/ranges.find.pass.cpp
@@ -10,10 +10,10 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-sign-compare
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-sign-compare
// MSVC warning C4242: 'argument': conversion from 'const _Ty' to 'ElementT', possible loss of data
// MSVC warning C4244: 'argument': conversion from 'const _Ty' to 'ElementT', possible loss of data
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4242 /wd4244
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4242 /wd4244
// template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
// requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
diff --git a/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp
index c43c2e5ac9537..23e576eeec24e 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/general.compile.pass.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// MSVC warning C4197: 'volatile std::atomic<operator_hijacker>': top-level volatile in cast is ignored
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4197
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4197
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp
index acc5464e5f690..478193db07717 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/pointer.compile.pass.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// MSVC warning C4197: 'volatile std::atomic<operator_hijacker *>': top-level volatile in cast is ignored
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4197
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4197
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
index 87c3ed0f8803d..ee77b1ac3c48b 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
@@ -10,7 +10,7 @@
// We voluntarily use std::default_initializable on types that have redundant
// or ignored cv-qualifiers -- don't warn about it.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-ignored-qualifiers
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-ignored-qualifiers
// template<class T>
// concept default_initializable = constructible_from<T> &&
diff --git a/libcxx/test/std/containers/associative/map/map.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/associative/map/map.modifiers/insert_range.pass.cpp
index 6f1c638840853..0d4b1c960a958 100644
--- a/libcxx/test/std/containers/associative/map/map.modifiers/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.modifiers/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-missing-field-initializers
// <map>
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_range.pass.cpp
index c9d259d03efe8..a804cbf0cf206 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.modifiers/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-missing-field-initializers
// <map>
diff --git a/libcxx/test/std/containers/associative/multiset/insert_range.pass.cpp b/libcxx/test/std/containers/associative/multiset/insert_range.pass.cpp
index eb125f1520ec1..d57e14f4b59c8 100644
--- a/libcxx/test/std/containers/associative/multiset/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-missing-field-initializers
// <set>
diff --git a/libcxx/test/std/containers/associative/set/insert_range.pass.cpp b/libcxx/test/std/containers/associative/set/insert_range.pass.cpp
index 1ae7f7d5cd16e..e6c54d84d6e40 100644
--- a/libcxx/test/std/containers/associative/set/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-missing-field-initializers
// <set>
diff --git a/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp b/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
index c93ea75c221da..d776d72b05467 100644
--- a/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
@@ -11,7 +11,7 @@
// template <size_t I, class T, size_t N> T& get(array<T, N>& a);
// Prevent -Warray-bounds from issuing a diagnostic when testing with clang verify.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-array-bounds
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-array-bounds
#include <array>
#include <cassert>
diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp
index f524273bdda03..d1c90c4ed4853 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.modifiers/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-missing-field-initializers
// <unordered_map>
diff --git a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp
index 7219225ff16d9..e6924ad52f6a7 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-missing-field-initializers
// <unordered_map>
diff --git a/libcxx/test/std/containers/unord/unord.multiset/insert_range.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/insert_range.pass.cpp
index 119091c007cb0..c2d5ed3278332 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-missing-field-initializers
// <set>
diff --git a/libcxx/test/std/containers/unord/unord.set/insert_range.pass.cpp b/libcxx/test/std/containers/unord/unord.set/insert_range.pass.cpp
index d9503808c7f2c..0fac2211af2eb 100644
--- a/libcxx/test/std/containers/unord/unord.set/insert_range.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/insert_range.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Some fields in the test case variables are deliberately not explicitly initialized, this silences a warning on GCC.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-missing-field-initializers
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-missing-field-initializers
// <set>
diff --git a/libcxx/test/std/containers/views/mdspan/layout_stride/deduction.pass.cpp b/libcxx/test/std/containers/views/mdspan/layout_stride/deduction.pass.cpp
index 5384f37fd40c7..259f61536ee37 100644
--- a/libcxx/test/std/containers/views/mdspan/layout_stride/deduction.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/layout_stride/deduction.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-ctad-maybe-unsupported
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-ctad-maybe-unsupported
// <mdspan>
diff --git a/libcxx/test/std/containers/views/mdspan/mdspan/conversion.pass.cpp b/libcxx/test/std/containers/views/mdspan/mdspan/conversion.pass.cpp
index 99d786d1d33f5..db22e148b34c5 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/conversion.pass.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/conversion.pass.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// MSVC warning C4244: 'initializing': conversion from '_Ty' to '_Ty', possible loss of data
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4244
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4244
// <mdspan>
diff --git a/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
index feeefc1194e85..f14173a753166 100644
--- a/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/setjmp_h.compile.pass.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// MSVC warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4611
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4611
// test <setjmp.h>
//
diff --git a/libcxx/test/std/depr/depr.numeric.limits.has.denorm/deprecated.verify.cpp b/libcxx/test/std/depr/depr.numeric.limits.has.denorm/deprecated.verify.cpp
index 9aa0d0b21d1e0..eb8611a85efba 100644
--- a/libcxx/test/std/depr/depr.numeric.limits.has.denorm/deprecated.verify.cpp
+++ b/libcxx/test/std/depr/depr.numeric.limits.has.denorm/deprecated.verify.cpp
@@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-unused-value
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-unused-value
#include <limits>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
index e6a6b650800b6..bcf05983eb759 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp
@@ -9,7 +9,7 @@
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// MSVC warning C4242: '+=': conversion from 'const _Ty' to 'size_t', possible loss of data
// MSVC warning C4244: 'argument': conversion from 'std::streamsize' to 'size_t', possible loss of data
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4242 /wd4244
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4242 /wd4244
// UNSUPPORTED: c++03
// <fstream>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
index 697ea7233de49..20c55cf0afbfd 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp
@@ -9,7 +9,7 @@
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
// MSVC warning C4242: '+=': conversion from 'const _Ty' to 'size_t', possible loss of data
// MSVC warning C4244: 'argument': conversion from 'std::streamsize' to 'size_t', possible loss of data
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4242 /wd4244
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4242 /wd4244
// UNSUPPORTED: c++03
// <fstream>
diff --git a/libcxx/test/std/language.support/support.runtime/csetjmp.pass.cpp b/libcxx/test/std/language.support/support.runtime/csetjmp.pass.cpp
index c95ebcf8c4b9d..5e23a4a21eb79 100644
--- a/libcxx/test/std/language.support/support.runtime/csetjmp.pass.cpp
+++ b/libcxx/test/std/language.support/support.runtime/csetjmp.pass.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// MSVC warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4611
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4611
// test <csetjmp>
diff --git a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
index 2a772ccb83f81..9734ed495f334 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/constraints.compile.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// This is a compile-only test, so "inline function is not defined" warnings are irrelevant.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-undefined-inline
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-undefined-inline
// template<input_range V, forward_range Pattern>
// requires view<V> && view<Pattern> &&
diff --git a/libcxx/test/std/ranges/range.utility/range.utility.conv/to.pass.cpp b/libcxx/test/std/ranges/range.utility/range.utility.conv/to.pass.cpp
index 719e6e818b68e..3df88d6a2dcc3 100644
--- a/libcxx/test/std/ranges/range.utility/range.utility.conv/to.pass.cpp
+++ b/libcxx/test/std/ranges/range.utility/range.utility.conv/to.pass.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// MSVC warning C4244: 'argument': conversion from '_Ty' to 'int', possible loss of data
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4244
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4244
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
diff --git a/libcxx/test/std/strings/basic.string/string.cons/from_range_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/from_range_deduction.pass.cpp
index 698f6d834f860..465840765da81 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/from_range_deduction.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/from_range_deduction.pass.cpp
@@ -10,7 +10,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// To silence a GCC warning-turned-error re. `BadAlloc::value_type`.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-unused-local-typedefs
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-unused-local-typedefs
// template<ranges::input_range R,
// class Allocator = allocator<ranges::range_value_t<R>>>
diff --git a/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp b/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp
index 992ff4a6cfadf..46c5f5f87bb9e 100644
--- a/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp
+++ b/libcxx/test/std/thread/thread.condition/notify_all_at_thread_exit_lwg3343.pass.cpp
@@ -18,7 +18,7 @@
// UNSUPPORTED: stdlib=apple-libc++ && target={{.+}}-apple-macosx11.{{.+}}
// MSVC warning C4583: 'X::cv_': destructor is not implicitly called
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd4583
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4583
// This is a regression test for LWG3343.
//
diff --git a/libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp b/libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp
index cb92e02faa4f2..d7e50fedd468f 100644
--- a/libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp
+++ b/libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp
@@ -10,7 +10,7 @@
// UNSUPPORTED: libcpp-has-no-experimental-stop_token
// UNSUPPORTED: c++03, c++11, c++14, c++17
// XFAIL: availability-synchronization_library-missing
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-self-move
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-self-move
// jthread& operator=(jthread&&) noexcept;
diff --git a/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp
index 22b718bfcadc9..935a6e3db0017 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/dependent_return_type.compile.pass.cpp
@@ -11,9 +11,9 @@
// UNSUPPORTED: c++03, c++11
// ignore deprecated volatile return types
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-deprecated-volatile
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-deprecated-volatile
// MSVC warning C5216: 'volatile int' a volatile qualified return type is deprecated in C++20
-// ADDITIONAL_COMPILE_FLAGS(msvc-cl-exe): /wd5216
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd5216
#include <type_traits>
#include <utility>
diff --git a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp
index 1c87019b9ea67..1b1f848e4d587 100644
--- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp
+++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp
@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03
// Self assignment post-conditions are tested.
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-self-move
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-self-move
// <memory>
diff --git a/libcxx/test/std/utilities/variant/variant.variant/implicit_ctad.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/implicit_ctad.pass.cpp
index b090291aeba48..80b38f986d0b6 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/implicit_ctad.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/implicit_ctad.pass.cpp
@@ -17,7 +17,7 @@
// We make sure that it is not ill-formed, however we still produce a warning for
// this one because explicit construction from a variant using CTAD is ambiguous
// (in the sense that the programer intent is not clear).
-// ADDITIONAL_COMPILE_FLAGS(any-clang-or-gcc): -Wno-ctad-maybe-unsupported
+// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-ctad-maybe-unsupported
#include <variant>
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index ebfc5b7fced8c..9bb82dedee7a8 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -66,8 +66,8 @@ def _getAndroidDeviceApi(cfg):
# Lit features are evaluated in order. Some checks may require the compiler detection to have
# run first in order to work properly.
DEFAULT_FEATURES = [
- # any-clang-or-gcc detects compilers that understand -Wno-meow flags, unlike MSVC's compiler driver cl.exe.
- Feature(name="any-clang-or-gcc", when=_isAnyClangOrGCC),
+ # gcc-style-warnings detects compilers that understand -Wno-meow flags, unlike MSVC's compiler driver cl.exe.
+ Feature(name="gcc-style-warnings", when=_isAnyClangOrGCC),
Feature(name="apple-clang", when=_isAppleClang),
Feature(
name=lambda cfg: "apple-clang-{__clang_major__}".format(**compilerMacros(cfg)),
>From 8b3656c4c464ad0a6c3db32dc61d4c5cdb02a116 Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Sun, 10 Dec 2023 04:57:05 -0800
Subject: [PATCH 11/13] Refactor `_isMeow` logic for clarity.
---
libcxx/utils/libcxx/test/features.py | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 9bb82dedee7a8..cbd32d2265a53 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -13,14 +13,12 @@
import subprocess
import sys
-_isAnyClangOrGCC = lambda cfg: "__clang__" in compilerMacros(
- cfg
-) or "__GNUC__" in compilerMacros(cfg)
-_isClang = lambda cfg: "__clang__" in compilerMacros(
- cfg
-) and "__apple_build_version__" not in compilerMacros(cfg)
+_isAnyClang = lambda cfg: "__clang__" in compilerMacros(cfg)
_isAppleClang = lambda cfg: "__apple_build_version__" in compilerMacros(cfg)
-_isGCC = lambda cfg: "__GNUC__" in compilerMacros(cfg) and "__clang__" not in compilerMacros(cfg)
+_isAnyGCC = lambda cfg: "__GNUC__" in compilerMacros(cfg)
+_isClang = lambda cfg: _isAnyClang(cfg) and not _isAppleClang(cfg)
+_isGCC = lambda cfg: _isAnyGCC(cfg) and not _isAnyClang(cfg)
+_isAnyClangOrGCC = lambda cfg: _isAnyClang(cfg) or _isAnyGCC(cfg)
_isMSVC = lambda cfg: "_MSC_VER" in compilerMacros(cfg)
_msvcVersion = lambda cfg: (int(compilerMacros(cfg)["_MSC_VER"]) // 100, int(compilerMacros(cfg)["_MSC_VER"]) % 100)
>From e784b3852a7c9a8a05edbe7b138d2abb203e2516 Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Mon, 11 Dec 2023 13:57:44 -0800
Subject: [PATCH 12/13] Add `(gcc-style-warnings)` to an inactive
`ADDITIONAL_COMPILE_FLAGS` in iterator.operations/advance.pass.cpp.
---
.../iterator.primitives/iterator.operations/advance.pass.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp b/libcxx/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp
index 8cf86407d7ad1..ba94cf67a6538 100644
--- a/libcxx/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp
@@ -27,7 +27,7 @@
// <TODO:Remove brackets> below
// Make sure we catch forced conversions to the difference_type if they happen.
-// ADDITIONAL_COMPILE_FLAGS<TODO:Remove brackets>: -Wsign-conversion
+// ADDITIONAL_COMPILE_FLAGS<TODO:Remove brackets>(gcc-style-warnings): -Wsign-conversion
#include <iterator>
#include <cassert>
>From f1ecc433cedb27ab00091b73f98003fb04cae4f7 Mon Sep 17 00:00:00 2001
From: "Stephan T. Lavavej" <stl at nuwen.net>
Date: Mon, 11 Dec 2023 14:12:16 -0800
Subject: [PATCH 13/13] Define `cl-style-warnings` when `not
_isAnyClangOrGCC(cfg)`.
---
libcxx/utils/libcxx/test/features.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index cbd32d2265a53..461e134f165fc 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -19,6 +19,7 @@
_isClang = lambda cfg: _isAnyClang(cfg) and not _isAppleClang(cfg)
_isGCC = lambda cfg: _isAnyGCC(cfg) and not _isAnyClang(cfg)
_isAnyClangOrGCC = lambda cfg: _isAnyClang(cfg) or _isAnyGCC(cfg)
+_isClExe = lambda cfg: not _isAnyClangOrGCC(cfg)
_isMSVC = lambda cfg: "_MSC_VER" in compilerMacros(cfg)
_msvcVersion = lambda cfg: (int(compilerMacros(cfg)["_MSC_VER"]) // 100, int(compilerMacros(cfg)["_MSC_VER"]) % 100)
@@ -66,6 +67,7 @@ def _getAndroidDeviceApi(cfg):
DEFAULT_FEATURES = [
# gcc-style-warnings detects compilers that understand -Wno-meow flags, unlike MSVC's compiler driver cl.exe.
Feature(name="gcc-style-warnings", when=_isAnyClangOrGCC),
+ Feature(name="cl-style-warnings", when=_isClExe),
Feature(name="apple-clang", when=_isAppleClang),
Feature(
name=lambda cfg: "apple-clang-{__clang_major__}".format(**compilerMacros(cfg)),
More information about the libcxx-commits
mailing list