[PATCH] D97990: [clang] Improve diagnostics on implicitly deleted defaulted comparisons

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 13 18:25:00 PST 2021


mizvekov added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8968-8970
 def note_defaulted_comparison_calls_deleted : Note<
   "defaulted %0 is implicitly deleted because it would invoke a deleted "
   "comparison function%select{| for member %2| for base class %2}1">;
----------------
mizvekov wrote:
> rsmith wrote:
> > Would it be useful to apply the same diagnostic improvement to this diagnostic too? (Genuine question: I *think* we'll attach a note pointing to the deleted function in this case, which would probably make the "for T" part just be noise, but I've not checked.)
> Yeah I thought about checking other errors for similar improvements. It's on my list to check that.
For this one in particular, we really do attach another note that makes it obvious, pointing to the explicitly marked deleted function.
`note_defaulted_comparison_not_constexpr` at first glance looks like might suffer from the same problem, but in this case I don't think the error ever could apply to the complete object.
And then nothing else that I could find.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97990/new/

https://reviews.llvm.org/D97990



More information about the cfe-commits mailing list