aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--lib/CodeGen/CGExprAgg.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 815e296e79..df90ee09f5 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -393,11 +393,10 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
}
uint64_t NumArrayElements = AType->getNumElements();
- QualType ElementType = E->getType()->getAsArrayType()->getElementType();
+ QualType ElementType = CGF.getContext().getCanonicalType(E->getType());
+ ElementType =CGF.getContext().getAsArrayType(ElementType)->getElementType();
- unsigned CVRqualifier =
- CGF.getContext().getCanonicalType(E->getType())->getAsArrayType()
- ->getElementType().getCVRQualifiers();
+ unsigned CVRqualifier = ElementType.getCVRQualifiers();
for (uint64_t i = 0; i != NumArrayElements; ++i) {
llvm::Value *NextVal = Builder.CreateStructGEP(DestPtr, i, ".array");