[cfe-commits] r131309 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Sean Hunt
scshunt at csclub.uwaterloo.ca
Fri May 13 14:10:11 PDT 2011
Author: coppro
Date: Fri May 13 16:10:11 2011
New Revision: 131309
URL: http://llvm.org/viewvc/llvm-project?rev=131309&view=rev
Log:
Fix copy constructor deletion detection with array types.
This fixes PR9910
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=131309&r1=131308&r2=131309&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri May 13 16:10:11 2011
@@ -3521,8 +3521,15 @@
}
}
- InitializedEntity MemberEntity =
- InitializedEntity::InitializeMember(*FI, 0);
+ llvm::SmallVector<InitializedEntity, 4> Entities;
+ QualType CurType = FI->getType();
+ Entities.push_back(InitializedEntity::InitializeMember(*FI, 0));
+ while (CurType->isArrayType()) {
+ Entities.push_back(InitializedEntity::InitializeElement(Context, 0,
+ Entities.back()));
+ CurType = Context.getAsArrayType(CurType)->getElementType();
+ }
+
InitializationKind Kind =
InitializationKind::CreateDirect(SourceLocation(), SourceLocation(),
SourceLocation());
@@ -3536,7 +3543,7 @@
Expr *Arg = new (Context) OpaqueValueExpr(SourceLocation(), ArgType,
VK_LValue);
- InitializationSequence InitSeq(*this, MemberEntity, Kind, &Arg, 1);
+ InitializationSequence InitSeq(*this, Entities.back(), Kind, &Arg, 1);
if (InitSeq.getKind() == InitializationSequence::FailedSequence)
return true;
More information about the cfe-commits
mailing list