[clang] [Clang]: enhance handling of [[deprecated]] attribute diagnostics for local variables (PR #113575)

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 25 00:22:10 PDT 2024


================
@@ -182,6 +182,12 @@ static bool ShouldDiagnoseAvailabilityInContext(
       return false;
   }
 
+  if (K == AR_Deprecated) {
+    if (const auto *VD = dyn_cast<VarDecl>(OffendingDecl))
+      if (VD->isLocalVarDecl() && VD->isDeprecated())
----------------
a-tarasyuk wrote:

@Sirraide thanks for the feedback. I've added changes.

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


More information about the cfe-commits mailing list