================
@@ -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;
----------------
zyn0217 wrote:
I explored a bit:
`FD && FD->isDefaulted()` doesn't cause us to warn for implicit rewritten
comparators, where the deprecated fields are involved when we synthesize the
body.
If we added an availability check to DefaultedComparisonVisitor, that worked
yet it resulted duplicated warnings. One when we synthesize the three-way
comparator, the other when we synthesize the body of rewritten operators.
Both the two operators are Defaulted and we cannot distinguish them.
https://github.com/llvm/llvm-project/pull/219177
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits