[clang-tools-extra] [clang-tidy][NFC] Add helper for deprecated check aliases (PR #189522)

Zeyi Xu via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 12 08:59:27 PDT 2026


================
@@ -0,0 +1,19 @@
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_CHECKUTILS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_CHECKUTILS_H
+
+#include "../ClangTidyDiagnosticConsumer.h"
+
+namespace clang::tidy::utils {
+
+/// Returns true when a check is running under a deprecated name and the user
+/// should be prompted to migrate to CanonicalName.
+inline bool isDeprecatedAlias(const ClangTidyContext &Context,
+                              StringRef DeprecatedName,
+                              StringRef CanonicalName) {
+  return Context.isCheckEnabled(DeprecatedName) &&
+         !Context.isCheckEnabled(CanonicalName);
----------------
zeyi2 wrote:

Fixed, thanks!

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


More information about the cfe-commits mailing list