diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-02-23 22:41:47 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-02-23 22:41:47 +0000 |
commit | fad0d791961d3f29e5340bba709be214c53e9d13 (patch) | |
tree | 325072b0feee96d38e3510c32cdcba576d909b22 /lib/Sema/SemaInit.cpp | |
parent | 0df4330a24251e7d19550819018be741e4b4b3e0 (diff) | |
download | clang-fad0d791961d3f29e5340bba709be214c53e9d13.tar.gz |
PR32044: Fix some cases where we would confuse a transparent init-list expression with an aggregate init.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296033 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index b8fee85516..3970e831c5 100644 --- a/lib/Sema/SemaInit.cpp +++ b/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()) |