summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2015-07-25 01:19:32 +0000
committerDavide Italiano <davide@freebsd.org>2015-07-25 01:19:32 +0000
commit922b702bf9d4a27cde8fe08f9bb694b8ca8d94ac (patch)
treed935c5f5fea7cfcca3e824ba4433f115fc027143 /clang/lib/Sema
parent28df04211cd50a0da0ef984e6163a32e3e38aa2b (diff)
downloadbcm5719-llvm-922b702bf9d4a27cde8fe08f9bb694b8ca8d94ac.tar.gz
bcm5719-llvm-922b702bf9d4a27cde8fe08f9bb694b8ca8d94ac.zip
[SemaTemplate] Detect instantiation of unparsed exceptions.
This fixes the clang crash reported in PR24000. Differential Revision: http://reviews.llvm.org/D11341 llvm-svn: 243196
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaExceptionSpec.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp
index 8a9372336e8..ec3d9fd82fe 100644
--- a/clang/lib/Sema/SemaExceptionSpec.cpp
+++ b/clang/lib/Sema/SemaExceptionSpec.cpp
@@ -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
OpenPOWER on IntegriCloud