aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 307db14b58..2acb482c41 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -404,7 +404,12 @@ InitListChecker::FillInValueInitializations(const InitializedEntity &Entity,
if (hadError) {
// Do nothing
} else if (Init < NumInits) {
- ILE->setInit(Init, ElementInit.takeAs<Expr>());
+ // For arrays, just set the expression used for value-initialization
+ // of the "holes" in the array.
+ if (ElementEntity.getKind() == InitializedEntity::EK_ArrayElement)
+ ILE->setArrayFiller(ElementInit.takeAs<Expr>());
+ else
+ ILE->setInit(Init, ElementInit.takeAs<Expr>());
} else {
// For arrays, just set the expression used for value-initialization
// of the rest of elements and exit.