mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
Revert accidental commit
llvm-svn: 91795
This commit is contained in:
@@ -3745,19 +3745,28 @@ void Sema::ActOnUninitializedDecl(DeclPtrTy dcl,
|
||||
InitType->isRecordType() && !InitType->isDependentType()) {
|
||||
if (!RequireCompleteType(Var->getLocation(), InitType,
|
||||
diag::err_invalid_incomplete_type_use)) {
|
||||
InitializedEntity Entity
|
||||
= InitializedEntity::InitializeVariable(Var);
|
||||
InitializationKind Kind
|
||||
= InitializationKind::CreateDefault(Var->getLocation());
|
||||
ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(*this);
|
||||
|
||||
InitializationSequence InitSeq(*this, Entity, Kind, 0, 0);
|
||||
OwningExprResult Init = InitSeq.Perform(*this, Entity, Kind,
|
||||
MultiExprArg(*this, 0, 0));
|
||||
if (Init.isInvalid())
|
||||
CXXConstructorDecl *Constructor
|
||||
= PerformInitializationByConstructor(InitType,
|
||||
MultiExprArg(*this, 0, 0),
|
||||
Var->getLocation(),
|
||||
SourceRange(Var->getLocation(),
|
||||
Var->getLocation()),
|
||||
Var->getDeclName(),
|
||||
InitializationKind::CreateDefault(Var->getLocation()),
|
||||
ConstructorArgs);
|
||||
|
||||
// FIXME: Location info for the variable initialization?
|
||||
if (!Constructor)
|
||||
Var->setInvalidDecl();
|
||||
else {
|
||||
Var->setInit(Context,
|
||||
MaybeCreateCXXExprWithTemporaries(Init.takeAs<Expr>()));
|
||||
// FIXME: Cope with initialization of arrays
|
||||
if (!Constructor->isTrivial() &&
|
||||
InitializeVarWithConstructor(Var, Constructor,
|
||||
move_arg(ConstructorArgs)))
|
||||
Var->setInvalidDecl();
|
||||
|
||||
FinalizeVarWithDestructor(Var, InitType);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user