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
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index 3dac125..966c1fe 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -100,6 +100,10 @@
SubExprs = new (C) Stmt*[TotalSize];
}
+bool CXXNewExpr::shouldNullCheckAllocation() const {
+ return getOperatorNew()->getType()->
+ castAs<FunctionProtoType>()->hasNonThrowingExceptionSpec();
+}
// CXXDeleteExpr
QualType CXXDeleteExpr::getDestroyedType() const {