erichkeane added a comment.

As Richard says, we should just be taking the first parameter type and using 
that instead (obviously de-qualified and removing reference if necessary).



================
Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:964
       } else if (DFK.isComparison()) {
-        Diags.Report(Active->PointOfInstantiation,
-                     diag::note_comparison_synthesized_at)
-            << (int)DFK.asComparison()
-            << Context.getTagDeclType(
-                   cast<CXXRecordDecl>(FD->getLexicalDeclContext()));
+        CXXRecordDecl *RD = nullptr;
+        for (Decl *D : FD->redecls()) {
----------------
According to the comment on the related bug:

```
This code predates P2085R0, prior to which a comparison function could only be 
defaulted lexically within the class. Given that we can't use the 
lexically-enclosing class any more, we can instead look at the (first) 
parameter type to determine which class's comparison is being defaulted.
...
since the lexical context isn't the right thing for us to be looking at any more
...
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151365

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to