Author: hans Date: Tue Jul 28 11:16:43 2015 New Revision: 243433 URL: http://llvm.org/viewvc/llvm-project?rev=243433&view=rev Log: Merging r243196: ------------------------------------------------------------------------ r243196 | davide | 2015-07-24 18:19:32 -0700 (Fri, 24 Jul 2015) | 6 lines
[SemaTemplate] Detect instantiation of unparsed exceptions. This fixes the clang crash reported in PR24000. Differential Revision: http://reviews.llvm.org/D11341 ------------------------------------------------------------------------ Added: cfe/branches/release_37/test/SemaTemplate/crash-unparsed-exception.cpp - copied unchanged from r243196, cfe/trunk/test/SemaTemplate/crash-unparsed-exception.cpp Modified: cfe/branches/release_37/ (props changed) cfe/branches/release_37/lib/Sema/SemaExceptionSpec.cpp Propchange: cfe/branches/release_37/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Jul 28 11:16:43 2015 @@ -1,4 +1,4 @@ /cfe/branches/type-system-rewrite:134693-134817 -/cfe/trunk:242244,242285,242293,242297,242313,242382,242422,242499,242574,242660,242662,242667,242678,242766,242905,242973,243018,243048,243098,243101,243105,243144,243153 +/cfe/trunk:242244,242285,242293,242297,242313,242382,242422,242499,242574,242660,242662,242667,242678,242766,242905,242973,243018,243048,243098,243101,243105,243144,243153,243196 /cfe/trunk/test:170344 /cfe/trunk/test/SemaTemplate:126920 Modified: cfe/branches/release_37/lib/Sema/SemaExceptionSpec.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/lib/Sema/SemaExceptionSpec.cpp?rev=243433&r1=243432&r2=243433&view=diff ============================================================================== --- cfe/branches/release_37/lib/Sema/SemaExceptionSpec.cpp (original) +++ cfe/branches/release_37/lib/Sema/SemaExceptionSpec.cpp Tue Jul 28 11:16:43 2015 @@ -161,7 +161,13 @@ Sema::ResolveExceptionSpec(SourceLocatio 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 _______________________________________________ llvm-branch-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-branch-commits
