forked from OSchip/llvm-project
Fix lifetime issue causing buildbot failures.
llvm-svn: 201012
This commit is contained in:
parent
8f80a61914
commit
f8b417c5ef
|
@ -2078,14 +2078,14 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,
|
|||
|
||||
FunctionProtoType::ExtProtoInfo EPI;
|
||||
|
||||
QualType BadAllocType;
|
||||
bool HasBadAllocExceptionSpec
|
||||
= (Name.getCXXOverloadedOperator() == OO_New ||
|
||||
Name.getCXXOverloadedOperator() == OO_Array_New);
|
||||
if (HasBadAllocExceptionSpec) {
|
||||
if (!getLangOpts().CPlusPlus11) {
|
||||
BadAllocType = Context.getTypeDeclType(getStdBadAlloc());
|
||||
assert(StdBadAlloc && "Must have std::bad_alloc declared");
|
||||
QualType BadAllocType = Context.getTypeDeclType(getStdBadAlloc());
|
||||
|
||||
EPI.ExceptionSpecType = EST_Dynamic;
|
||||
EPI.NumExceptions = 1;
|
||||
EPI.Exceptions = &BadAllocType;
|
||||
|
|
Loading…
Reference in New Issue