r208062 - Fix crash when one overload candidate is a template instead of a function. Patch by Kaelyn Takata.
Nick Lewycky
nicholas at mxc.ca
Mon May 5 23:35:27 PDT 2014
Author: nicholas
Date: Tue May 6 01:35:27 2014
New Revision: 208062
URL: http://llvm.org/viewvc/llvm-project?rev=208062&view=rev
Log:
Fix crash when one overload candidate is a template instead of a function. Patch by Kaelyn Takata.
Testcase coming out of creduce will land in a separate commit shortly.
Also, it appears that this callback is used even in a SFINAE context where the results are never displayed.
Modified:
cfe/trunk/lib/Sema/SemaOverload.cpp
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=208062&r1=208061&r2=208062&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Tue May 6 01:35:27 2014
@@ -9260,6 +9260,7 @@ struct CompareOverloadCandidatesForDispl
L->FailureKind == ovl_fail_too_few_arguments) {
if (R->FailureKind == ovl_fail_too_many_arguments ||
R->FailureKind == ovl_fail_too_few_arguments) {
+ if (!L->Function || !R->Function) return !R->Function;
int LDist = std::abs((int)L->Function->getNumParams() - (int)NumArgs);
int RDist = std::abs((int)R->Function->getNumParams() - (int)NumArgs);
if (LDist == RDist)
More information about the cfe-commits
mailing list