diff options
author | Francois Pichet <pichet2000@gmail.com> | 2010-11-21 06:08:52 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2010-11-21 06:08:52 +0000 |
commit | 87c2e121cf0522fc266efe2922b58091cd2e0182 (patch) | |
tree | 0def875d14aa76bd01d54b4ebb9a41db1007c6a7 /lib/Sema/SemaInit.cpp | |
parent | a4c2475961184a4bad6f6f087eeb1038bb784cad (diff) |
Major anonymous union/struct redesign.
A new AST node is introduced:
def IndirectField : DDecl<Value>;
IndirectFields are injected into the anonymous's parent scope and chain back to
the original field. Name lookup for anonymous entities now result in an
IndirectFieldDecl instead of a FieldDecl.
There is no functionality change, the code generated should be the same.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119919 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 9458e3580c..1b47332c53 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -1429,6 +1429,11 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, } else if (!KnownField) { // Determine whether we found a field at all. ReplacementField = dyn_cast<FieldDecl>(*Lookup.first); + + // Check if ReplacementField is an anonymous field. + if (!ReplacementField) + if (IndirectFieldDecl* IField = dyn_cast<IndirectFieldDecl>(*Lookup.first)) + ReplacementField = IField->getAnonField(); } if (!ReplacementField) { |