From: Eli Friedman Date: Fri, 25 Dec 2009 23:59:21 +0000 (+0000) Subject: Attempted fix for PR5884; this code will be dead soon, but this fix should X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6d11b75f68980645fa695b56dc24487ecf13c32;p=clang Attempted fix for PR5884; this code will be dead soon, but this fix should help for the moment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92165 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 30c799305d..a1800755bd 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -1114,14 +1114,13 @@ Sema::BuildMemberInitializer(FieldDecl *Member, Expr **Args, QualType FieldType = Member->getType(); if (const ArrayType *Array = Context.getAsArrayType(FieldType)) FieldType = Array->getElementType(); + ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(*this); if (FieldType->isDependentType()) { // Can't check init for dependent type. } else if (FieldType->isRecordType()) { // Member is a record (struct/union/class), so pass the initializer // arguments down to the record's constructor. if (!HasDependentArg) { - ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(*this); - C = PerformInitializationByConstructor(FieldType, MultiExprArg(*this, (void**)Args, @@ -1243,10 +1242,10 @@ Sema::BuildBaseInitializer(QualType BaseType, TypeSourceInfo *BaseTInfo, } CXXConstructorDecl *C = 0; + ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(*this); if (!BaseType->isDependentType() && !HasDependentArg) { DeclarationName Name = Context.DeclarationNames.getCXXConstructorName( Context.getCanonicalType(BaseType).getUnqualifiedType()); - ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(*this); C = PerformInitializationByConstructor(BaseType, MultiExprArg(*this,