Fix a crasher than manifests when typo correction suggests a function template.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187467 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 5b0029a..65654b6 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -3932,7 +3932,7 @@
<< Fn->getSourceRange() << CorrectedQuotedStr
<< FixItHint::CreateReplacement(TC.getCorrectionRange(),
CorrectedStr);
- Diag(TC.getCorrectionDeclAs<FunctionDecl>()->getLocStart(),
+ Diag(TC.getCorrectionDecl()->getLocStart(),
diag::note_previous_decl) << CorrectedQuotedStr;
} else if (MinArgs == 1 && FDecl && FDecl->getParamDecl(0)->getDeclName())
Diag(RParenLoc, MinArgs == NumArgsInProto && !Proto->isVariadic()
@@ -3978,7 +3978,7 @@
<< Fn->getSourceRange() << CorrectedQuotedStr
<< FixItHint::CreateReplacement(TC.getCorrectionRange(),
CorrectedStr);
- Diag(TC.getCorrectionDeclAs<FunctionDecl>()->getLocStart(),
+ Diag(TC.getCorrectionDecl()->getLocStart(),
diag::note_previous_decl) << CorrectedQuotedStr;
} else if (NumArgsInProto == 1 && FDecl && FDecl->getParamDecl(0)->getDeclName())
Diag(Args[NumArgsInProto]->getLocStart(),