diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-27 21:20:31 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-27 21:20:31 +0000 |
commit | 7d125a11f152e1907b4eb50e48430cd89c0f130e (patch) | |
tree | e9cdd324af8da659087dcadce13979c2f1185a18 /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | ee4baf3eec43d8a92f5e1d79bc8a19ebaceb40a1 (diff) | |
download | bcm5719-llvm-7d125a11f152e1907b4eb50e48430cd89c0f130e.tar.gz bcm5719-llvm-7d125a11f152e1907b4eb50e48430cd89c0f130e.zip |
Simplify checking for whether we should implicitly declare special members and
add some assertions. No functionality change.
llvm-svn: 168725
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index e98f75ebe6d..e950f3eb098 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -6991,7 +6991,7 @@ CXXConstructorDecl *Sema::DeclareImplicitDefaultConstructor( // user-declared constructor for class X, a default constructor is // implicitly declared. An implicitly-declared default constructor // is an inline public member of its class. - assert(!ClassDecl->hasUserDeclaredConstructor() && + assert(ClassDecl->needsImplicitDefaultConstructor() && "Should not build implicit default constructor!"); bool Constexpr = defaultedSpecialMemberIsConstexpr(*this, ClassDecl, @@ -7304,6 +7304,7 @@ CXXDestructorDecl *Sema::DeclareImplicitDestructor(CXXRecordDecl *ClassDecl) { // If a class has no user-declared destructor, a destructor is // declared implicitly. An implicitly-declared destructor is an // inline public member of its class. + assert(!ClassDecl->hasDeclaredDestructor()); // Create the actual destructor declaration. CanQualType ClassType @@ -7856,6 +7857,7 @@ CXXMethodDecl *Sema::DeclareImplicitCopyAssignment(CXXRecordDecl *ClassDecl) { // constructor rules. Note that virtual bases are not taken into account // for determining the argument type of the operator. Note also that // operators taking an object instead of a reference are allowed. + assert(!ClassDecl->hasDeclaredCopyAssignment()); QualType ArgType = Context.getTypeDeclType(ClassDecl); QualType RetType = Context.getLValueReferenceType(ArgType); @@ -8695,6 +8697,7 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor( // C++ [class.copy]p4: // If the class definition does not explicitly declare a copy // constructor, one is declared implicitly. + assert(!ClassDecl->hasDeclaredCopyConstructor()); QualType ClassType = Context.getTypeDeclType(ClassDecl); QualType ArgType = ClassType; |