[SemaTemplate] Detect instantiation of unparsed exceptions.

This fixes the clang crash reported in PR24000.

Differential Revision:	http://reviews.llvm.org/D11341

llvm-svn: 243196
This commit is contained in:
Davide Italiano
2015-07-25 01:19:32 +00:00
parent 28df04211c
commit 922b702bf9
2 changed files with 24 additions and 1 deletions

View File

@@ -161,7 +161,13 @@ Sema::ResolveExceptionSpec(SourceLocation Loc, const FunctionProtoType *FPT) {
else
InstantiateExceptionSpec(Loc, SourceDecl);
return SourceDecl->getType()->castAs<FunctionProtoType>();
const FunctionProtoType *Proto =
SourceDecl->getType()->castAs<FunctionProtoType>();
if (Proto->getExceptionSpecType() == clang::EST_Unparsed) {
Diag(Loc, diag::err_exception_spec_not_parsed);
Proto = nullptr;
}
return Proto;
}
void