================
@@ -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);
----------------
vbvictor wrote:
On second thought, can we instead pass `diag()` object here and make diagnostic
as well?
So we don't have to duplicate `if(..) diag("you have deprecated..")`.
I suspect we wouldn't be able to test it in UnitTests
https://github.com/llvm/llvm-project/pull/189522
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits