]> granicus.if.org Git - clang/commit
Rewrite default initialization of anonymous structs/unions within a
authorDouglas Gregor <dgregor@apple.com>
Wed, 10 Aug 2011 15:22:55 +0000 (15:22 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 10 Aug 2011 15:22:55 +0000 (15:22 +0000)
commit4dc41c9b766140b507980a13acccf2f05ed19cd3
tree6f8414fea61986be50a747cf866b7ae4fe4443fd
parenta19950edd94c1b80e73c9f45d821b125bd0ee72f
Rewrite default initialization of anonymous structs/unions within a
constructor. Previously, we did some bogus recursion into the fields
of anonymous structs (recursively), which ended up building invalid
ASTs that would cause CodeGen to crash due to invalid GEPs.

Now, we instead build the default initializations based on the
indirect field declarations at the top level, which properly generates
the sequence of GEPs needed to initialize the proper member. Fixes
PR10512 and <rdar://problem/9924046>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137212 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDeclCXX.cpp
test/CodeGenCXX/anonymous-union-member-initializer.cpp