[libcxx-commits] [libcxx] [libc++] Add a utility for checking the output of commands (PR #65917)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 20 12:42:29 PST 2024


================
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: has-clang-tidy
+
+// RUN: %{clang-tidy} %s -header-filter=.* --checks='-*,libcpp-cpp-version-check' --load=%{test-tools}/clang_tidy_checks/libcxx-tidy.plugin -- %{compile_flags} -fno-modules 2>&1 | %{check-output}
+
+#include <__config>
+
+// CHECK: warning: _LIBCPP_STD_VER >= version should be used instead of _LIBCPP_STD_VER > prev_version
----------------
ldionne wrote:

IIRC we had a Discourse RFC about it and I remember there was wide support for this. In particular, it was deemed much less confusing to potentially update `_LIBCPP_STD_VER >= 26` to `_LIBCPP_STD_VER >= 27` in case ISO C++ slips (which won't happen in practice) than to use `> 23`, which looked weird to a lot of contributors.

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


More information about the libcxx-commits mailing list