aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprCXX.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-03-07 03:12:35 +0000
committerJohn McCall <rjmccall@apple.com>2011-03-07 03:12:35 +0000
commitc2f3e7f42c8bf9e8d4393a6e8c4762dafc4f28dd (patch)
treec4730e8c00f37734a9138341ee3535c06fe92a78 /lib/AST/ExprCXX.cpp
parent0a0367a479e2ad204a97f87ed72f18209169b775 (diff)
The conditional needs to be pushed before the branch. Make the test less
trivial to check this. Adjust for style. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprCXX.cpp')
-rw-r--r--lib/AST/ExprCXX.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index 3dac125990..966c1fe6a7 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -100,6 +100,10 @@ void CXXNewExpr::AllocateArgsArray(ASTContext &C, bool isArray,
SubExprs = new (C) Stmt*[TotalSize];
}
+bool CXXNewExpr::shouldNullCheckAllocation() const {
+ return getOperatorNew()->getType()->
+ castAs<FunctionProtoType>()->hasNonThrowingExceptionSpec();
+}
// CXXDeleteExpr
QualType CXXDeleteExpr::getDestroyedType() const {