]> granicus.if.org Git - clang/commitdiff
Fix a thinko.
authorAnders Carlsson <andersca@mac.com>
Mon, 1 Jun 2009 00:26:14 +0000 (00:26 +0000)
committerAnders Carlsson <andersca@mac.com>
Mon, 1 Jun 2009 00:26:14 +0000 (00:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72679 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCXX.cpp
test/CodeGenCXX/new.cpp

index 32152f96bf0719761fafe396c71825ab6a3ab700..731e38c5146d061b460e157f4af097926f3f8f42 100644 (file)
@@ -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.");
 
index 70ad269d24a2b2c9ce96655e387e48a40e3713e9..480bbcefc08d521c122058b79908cf4f6e6264b4 100644 (file)
@@ -50,3 +50,7 @@ int *t6() {
   // Null check.
   return new (0) int(10);
 }
+
+void t7() {
+  new int();
+}