[libcxx-commits] [libcxx] [libc++] Clang-tidy operator& hijacker. (PR #128366)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Mar 25 01:30:15 PDT 2025
================
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// 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"
+#include "clang-tidy/ClangTidyModuleRegistry.h"
+#include "clang/Tooling/FixIt.h"
+
+#include "robust_against_operator_ampersand.hpp"
+
+// This clang-tidy check ensures that we don't use operator& on dependant
+// types. If the type is user supplied it may call the type's operator&.
+// Instead use std::addressof.
----------------
philnik777 wrote:
The guidelines should still document that this check exists. IMO this comment isn't useful, since it will get out of sync with the guidelines. I'd be much happier with a reference to the guidelines than documenting the same thing in different places.
https://github.com/llvm/llvm-project/pull/128366
More information about the libcxx-commits
mailing list