[clang-tools-extra] [clang-tidy] Emit warning when user is using deprecated `zircon` checks (PR #189522)
Zeyi Xu via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 12 09:06:42 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:
> I suspect we wouldn't be able to test it in UnitTests
I found a way to test this (though not convenient) :)
https://github.com/llvm/llvm-project/pull/189522
More information about the cfe-commits
mailing list