diff options
author | Anders Carlsson <andersca@mac.com> | 2009-06-01 00:26:14 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-06-01 00:26:14 +0000 |
commit | 215bd208d6eeff397bc4316d046ea8b4633efedf (patch) | |
tree | 774c7d166956d5c74f61f91bd40309ea2227e911 | |
parent | f11085398dc27c0010663c711d4a10113e41d70f (diff) |
Fix a thinko.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72679 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 2 | ||||
-rw-r--r-- | test/CodeGenCXX/new.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index 32152f96bf..731e38c514 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -315,7 +315,7 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) { NewPtr = Builder.CreateBitCast(NewPtr, ConvertType(E->getType())); if (AllocType->isPODType()) { - if (E->hasInitializer()) { + if (E->getNumConstructorArgs() > 0) { assert(E->getNumConstructorArgs() == 1 && "Can only have one argument to initializer of POD type."); diff --git a/test/CodeGenCXX/new.cpp b/test/CodeGenCXX/new.cpp index 70ad269d24..480bbcefc0 100644 --- a/test/CodeGenCXX/new.cpp +++ b/test/CodeGenCXX/new.cpp @@ -50,3 +50,7 @@ int *t6() { // Null check. return new (0) int(10); } + +void t7() { + new int(); +} |