[cfe-commits] r71163 - /cfe/trunk/lib/Sema/SemaExprCXX.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Thu May 7 09:14:43 PDT 2009
Author: cornedbee
Date: Thu May 7 11:14:23 2009
New Revision: 71163
URL: http://llvm.org/viewvc/llvm-project?rev=71163&view=rev
Log:
Fix a FIXME in new expression checking.
Modified:
cfe/trunk/lib/Sema/SemaExprCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=71163&r1=71162&r2=71163&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Thu May 7 11:14:23 2009
@@ -340,14 +340,13 @@
// 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 @@
// 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))
More information about the cfe-commits
mailing list