diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-28 20:38:10 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-28 20:38:10 +0000 |
commit | 9d5938ae8a117868a8258e6c2ca6f444e31274fd (patch) | |
tree | 3525fff120a6e19745c63aaf64a669396db6605b /clang/lib/Sema/SemaDecl.cpp | |
parent | 750272d912f1233d12206782d75dabbc690770b2 (diff) | |
download | bcm5719-llvm-9d5938ae8a117868a8258e6c2ca6f444e31274fd.tar.gz bcm5719-llvm-9d5938ae8a117868a8258e6c2ca6f444e31274fd.zip |
Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.
This reinstates r114924, with one crucial bug fix: we were ignoring
the implicit fields created by anonymous structs/unions when updating
the bits in CXXRecordDecl, which means that a class/struct containing
only an anonymous class/struct would be considered "empty". Hilarity
follows.
llvm-svn: 114980
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 5ac6f618d30..e6e4420f23b 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1958,11 +1958,8 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS, TInfo, /*BitWidth=*/0, /*Mutable=*/false); Anon->setAccess(AS); - if (getLangOptions().CPlusPlus) { + if (getLangOptions().CPlusPlus) FieldCollector->Add(cast<FieldDecl>(Anon)); - if (!cast<CXXRecordDecl>(Record)->isEmpty()) - cast<CXXRecordDecl>(OwningClass)->setEmpty(false); - } } else { DeclSpec::SCS SCSpec = DS.getStorageClassSpec(); assert(SCSpec != DeclSpec::SCS_typedef && @@ -6190,8 +6187,6 @@ FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T, if (!InvalidDecl && getLangOptions().CPlusPlus) { CXXRecordDecl* CXXRecord = cast<CXXRecordDecl>(Record); - if (!ZeroWidth) - CXXRecord->setEmpty(false); if (T->isReferenceType()) CXXRecord->setHasTrivialConstructor(false); |