================ @@ -2968,6 +3161,29 @@ bool Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range, // deallocation function will be called. if (Matches.size() == 1) { OperatorDelete = Matches[0].second; + if (IsTypeAwareOperatorNewOrDelete(OperatorDelete) != + IAP.PassTypeIdentity) { + Diag(StartLoc, diag::warn_mismatching_type_aware_cleanup_deallocator); + int NewDiagIndex = IsTypeAwareOperatorNewOrDelete(OperatorNew) ? 0 : 1; + int DeleteDiagIndex = + IsTypeAwareOperatorNewOrDelete(OperatorDelete) ? 0 : 1; + Diag(OperatorNew->getLocation(), diag::note_type_aware_operator_declared) + << NewDiagIndex << OperatorNew->getDeclName(); ---------------- AaronBallman wrote:
The diagnostics engine knows how to print named declarations, so I think you can drop the `getDeclName()` calls when emitting these diagnostics. https://github.com/llvm/llvm-project/pull/113510 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits