aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-05-07 16:14:23 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-05-07 16:14:23 +0000
commit4f149632ed57f3136f330d230100b9787d938a3e (patch)
treebe99af15eb1c6d07c330d821abb9c05eb38825b7 /lib/Sema/SemaExprCXX.cpp
parenta6c0e07df204c5719aa6ef12456830a9af2c7fbe (diff)
Fix a FIXME in new expression checking.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71163 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r--lib/Sema/SemaExprCXX.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 4c3c85bbf5..92df67aa47 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -340,14 +340,13 @@ Sema::ActOnCXXNew(SourceLocation StartLoc, bool UseGlobal,
// 2) Otherwise, the object is direct-initialized.
CXXConstructorDecl *Constructor = 0;
Expr **ConsArgs = (Expr**)ConstructorArgs.get();
+ const RecordType *RT;
unsigned NumConsArgs = ConstructorArgs.size();
if (AllocType->isDependentType()) {
// Skip all the checks.
}
- // FIXME: Should check for primitive/aggregate here, not record.
- else if (const RecordType *RT = AllocType->getAsRecordType()) {
- // FIXME: This is incorrect for when there is an empty initializer and
- // no user-defined constructor. Must zero-initialize, not default-construct.
+ else if ((RT = AllocType->getAsRecordType()) &&
+ !AllocType->isAggregateType()) {
Constructor = PerformInitializationByConstructor(
AllocType, ConsArgs, NumConsArgs,
D.getSourceRange().getBegin(),
@@ -367,7 +366,7 @@ Sema::ActOnCXXNew(SourceLocation StartLoc, bool UseGlobal,
// Object is value-initialized. Do nothing.
} else if (NumConsArgs == 1) {
// Object is direct-initialized.
- // FIXME: WHAT DeclarationName do we pass in here?
+ // FIXME: What DeclarationName do we pass in here?
if (CheckInitializerTypes(ConsArgs[0], AllocType, StartLoc,
DeclarationName() /*AllocType.getAsString()*/,
/*DirectInit=*/true))