[llvm-branch-commits] [libcxx] [libc++] Clang-tidy operator& hijacker. (PR #128366)

Louis Dionne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 25 09:08:44 PST 2025


================
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang-tidy/ClangTidyCheck.h"
+
+namespace libcpp {
+class robust_against_operator_ampersand : public clang::tidy::ClangTidyCheck {
+  // At the moment libc++ is phasing out development on C++03.
+  // To avoid testing in C++03, this test is automatically disabled in C++03
+  // mode. (Doing this from the tests is a lot harder.)
+  // TODO Remove after dropping C++03 support.
----------------
ldionne wrote:

We actually never plan to "drop" C++03 support, which means that we'd basically need to keep this C++03 carve-out forever. Unless we stop running `clang-tidy` in C++03 mode altogether, which would be another option.

I think in either case we can actually achieve the desired result by simply `XFAIL`ing (or `UNSUPPORTED`) the `clang_tidy.gen.py` test based on `FROZEN-CXX03-HEADERS-FIXME`.

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


More information about the llvm-branch-commits mailing list