diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-05-22 05:34:26 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-05-22 05:34:26 +0000 |
| commit | 5cfda6feb15a3765b97a06961623637772cb92fc (patch) | |
| tree | 1c128d233883ea23b1cf7a582d6acf26f91d0df6 /clang/lib | |
| parent | 783fc635f6252f1d6e978118770f1e949ffd580b (diff) | |
| download | bcm5719-llvm-5cfda6feb15a3765b97a06961623637772cb92fc.tar.gz bcm5719-llvm-5cfda6feb15a3765b97a06961623637772cb92fc.zip | |
[AST] Cleanup comments regarding CXXRecordDecl::isEmpty
We were missing references to the standard, some of our home-grown
verbiage didn't make any sense.
No functional change is intended.
llvm-svn: 270353
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index 9dc0771eadb..45205e8b201 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -172,8 +172,6 @@ CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases, CXXRecordDecl *BaseClassDecl = cast<CXXRecordDecl>(BaseType->getAs<RecordType>()->getDecl()); - // A class with a non-empty base class is not empty. - // FIXME: Standard ref? if (!BaseClassDecl->isEmpty()) { if (!data().Empty) { // C++0x [class]p7: @@ -187,6 +185,9 @@ CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases, data().IsStandardLayout = false; } + // C++14 [meta.unary.prop]p4: + // T is a class type [...] with [...] no base class B for which + // is_empty<B>::value is false. data().Empty = false; data().HasNoNonEmptyBases = false; } @@ -238,9 +239,9 @@ CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases, if (SeenVBaseTypes.insert(C.getCanonicalType(BaseType)).second) VBases.push_back(Base); - // C++11 [meta.unary.prop] is_empty: - // T is a class type, but not a union type, with ... no virtual base - // classes + // C++14 [meta.unary.prop] is_empty: + // T is a class type, but not a union type, with ... no virtual base + // classes data().Empty = false; // C++1z [dcl.init.agg]p1: @@ -458,8 +459,8 @@ void CXXRecordDecl::addedMember(Decl *D) { // A POD-struct is an aggregate class... data().PlainOldData = false; - // Virtual functions make the class non-empty. - // FIXME: Standard ref? + // C++14 [meta.unary.prop]p4: + // T is a class type [...] with [...] no virtual member functions... data().Empty = false; // C++ [class.virtual]p1: @@ -938,7 +939,9 @@ void CXXRecordDecl::addedMember(Decl *D) { if (!data().HasNoNonEmptyBases) data().IsStandardLayout = false; - // If this is not a zero-length bit-field, then the class is not empty. + // C++14 [meta.unary.prop]p4: + // T is a class type [...] with [...] no non-static data members other + // than bit-fields of length 0... if (data().Empty) { if (!Field->isBitField() || (!Field->getBitWidth()->isTypeDependent() && |

