[libcxx-commits] [libcxx] [llvm] [RFC][libc++][test] Improves C++ Standard filtering. (PR #89499)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 3 09:07:54 PDT 2024


================
@@ -165,11 +165,28 @@ def getSuitableClangTidy(cfg):
         default=lambda cfg: next(
             s for s in reversed(_allStandards) if getStdFlag(cfg, s)
         ),
-        actions=lambda std: [
+        actions=lambda std: filter(None, [
             AddFeature(std),
+
+            AddFeature("<=c++03") if std <= "c++03" else None,
+            AddFeature("<=c++11") if std <= "c++11" else None,
+            AddFeature("<=c++14") if std <= "c++14" else None,
+            AddFeature("<=c++17") if std <= "c++17" else None,
+            AddFeature("<=c++20") if std <= "c++20" else None,
+            AddFeature("<=c++23") if std <= "c++23" else None,
+            AddFeature("<=c++26") if std <= "c++26" else None,
----------------
ldionne wrote:

One issue I have with this is that it's an invitation for people to write something like `REQUIRES: >c++20`, and that would never be a defined feature. Similarly, people would legitimately expect `>= c++23` (with a space) to work, but it won't.

I wonder if that isn't creating a footgun if we don't "fully" support these relational operators at a more fundamental level.

https://github.com/llvm/llvm-project/pull/89499


More information about the libcxx-commits mailing list