[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>
Tue, 19 Apr 2022 08:45:28 +0000 (04:45 -0400)
commit454d1df9423c95e54c3a2f5cb58d864096032d09
tree81ef9732a31a1ae9ed2c20588b8f61c4a7a86d94
parentf707e1255e2f0a46c7a23271f594a9a4e5ec8f08
[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]