As noticed in GH58962, we should only diagnose illegal overloads of member functions
when the ref qualifiers don't match if the trailing constraints are the same.
The fix is to move the existing constraints check earlier in Sema::IsOverload.
Paths
| Differential D138749
[clang] Compare constraints before diagnosing mismatched ref qualifiers (GH58962) ClosedPublic Authored by royjacobson on Nov 26 2022, 3:01 PM.
Details Summary As noticed in GH58962, we should only diagnose illegal overloads of member functions The fix is to move the existing constraints check earlier in Sema::IsOverload.
Diff Detail
Event TimelineComment Actions I can't find any example that breaks and needs the AreConstraintExpressionsEqual, so feel free to do it if you'd like.
This revision is now accepted and ready to land.Nov 28 2022, 6:09 AM royjacobson added inline comments. This revision was landed with ongoing or failed builds.Nov 29 2022, 4:57 AM Closed by commit rG3c75feab3bbd: [clang] Compare constraints before diagnosing mismatched ref qualifiers… (authored by royjacobson). · Explain Why This revision was automatically updated to reflect the committed changes. royjacobson marked 2 inline comments as done.
Revision Contents
Diff 478531 clang/lib/Sema/SemaOverload.cpp
clang/test/CXX/over/over.load/p2-0x.cpp
|
I know it's preexisting but, I'm not sure that comment adds anything.
If we want to keep it, "requires clauses are different, - these are overloads."