[Concepts] Fix overload resolution bug with constrained candidates
authorRoy Jacobson <roi.jacobson1@gmail.com>
Fri, 15 Apr 2022 15:58:11 +0000 (11:58 -0400)
committerRoy Jacobson <roi.jacobson1@gmail.com>
Sat, 23 Apr 2022 21:24:59 +0000 (17:24 -0400)
commit807e418413a0958ad1ea862093fb262673b2afa1
treee172c9be943d8e2e941f62acca3a9845e3edac31
parent4681f6111e655057f5015564a9bf3705f87495bf
[Concepts] Fix overload resolution bug with constrained candidates

When doing overload resolution, we have to check that candidates' parameter types are equal before trying to find a better candidate through checking which candidate is more constrained.
This revision adds this missing check and makes us diagnose those cases as ambiguous calls when the types are not equal.

Fixes GitHub issue https://github.com/llvm/llvm-project/issues/53640

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D123182
clang/docs/ReleaseNotes.rst
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaOverload.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/test/CXX/temp/temp.decls/temp.fct/temp.func.order/p6.cpp [new file with mode: 0644]