]> granicus.if.org Git - clang/commitdiff
Fix crash when one overload candidate is a template instead of a function. Patch...
authorNick Lewycky <nicholas@mxc.ca>
Tue, 6 May 2014 06:35:27 +0000 (06:35 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Tue, 6 May 2014 06:35:27 +0000 (06:35 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208062 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaOverload.cpp

index 70f5dba56d8381c4cc7e5552a97d75ffa2b4c612..7f9e0ecd96fce2a37ac8253a97b9ab65fa1bfb06 100644 (file)
@@ -9260,6 +9260,7 @@ struct CompareOverloadCandidatesForDisplay {
           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)