[clang] [Clang] Only omit deprecation warnings for implicit special members (PR #219177)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 27 04:48:23 PDT 2026


================
@@ -212,6 +212,10 @@ static bool ShouldDiagnoseAvailabilityInContext(
     } else if (K == AR_Deprecated) {
       if (C->isDeprecated())
         return true;
+      // Don't emit deprecated warnings when defining special member functions.
+      if (const auto *FD = dyn_cast<FunctionDecl>(C);
+          FD && FD->isDefaulted() && FD->isImplicit())
+        return true;
----------------
cor3ntin wrote:

That seems somewhat brittle.
Can we instead check if the function is a CXXDeductionGuide?

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


More information about the cfe-commits mailing list