[cfe-commits] r72679 - in /cfe/trunk: lib/CodeGen/CGCXX.cpp test/CodeGenCXX/new.cpp
Anders Carlsson
andersca at mac.com
Sun May 31 17:26:14 PDT 2009
Author: andersca
Date: Sun May 31 19:26:14 2009
New Revision: 72679
URL: http://llvm.org/viewvc/llvm-project?rev=72679&view=rev
Log:
Fix a thinko.
Modified:
cfe/trunk/lib/CodeGen/CGCXX.cpp
cfe/trunk/test/CodeGenCXX/new.cpp
Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=72679&r1=72678&r2=72679&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Sun May 31 19:26:14 2009
@@ -315,7 +315,7 @@
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.");
Modified: cfe/trunk/test/CodeGenCXX/new.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/new.cpp?rev=72679&r1=72678&r2=72679&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/new.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/new.cpp Sun May 31 19:26:14 2009
@@ -50,3 +50,7 @@
// Null check.
return new (0) int(10);
}
+
+void t7() {
+ new int();
+}
More information about the cfe-commits
mailing list