summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-02-23 22:41:47 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-02-23 22:41:47 +0000
commit382bc51fddbfb010b2e068bbdf94ab99811b2768 (patch)
treea3e11869468d7db13f7c46708c3a9d85f26b8bb9 /clang/lib/Sema
parent620db1f3dd08ebbba71b0e16f83c11323e04bc05 (diff)
downloadbcm5719-llvm-382bc51fddbfb010b2e068bbdf94ab99811b2768.tar.gz
bcm5719-llvm-382bc51fddbfb010b2e068bbdf94ab99811b2768.zip
PR32044: Fix some cases where we would confuse a transparent init-list expression with an aggregate init.
llvm-svn: 296033
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaInit.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index b8fee85516e..3970e831c5c 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -623,6 +623,11 @@ InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity,
assert((ILE->getType() != SemaRef.Context.VoidTy) &&
"Should not have void type");
+ // A transparent ILE is not performing aggregate initialization and should
+ // not be filled in.
+ if (ILE->isTransparent())
+ return;
+
if (const RecordType *RType = ILE->getType()->getAs<RecordType>()) {
const RecordDecl *RDecl = RType->getDecl();
if (RDecl->isUnion() && ILE->getInitializedFieldInUnion())
OpenPOWER on IntegriCloud