aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-11-27 21:20:31 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-11-27 21:20:31 +0000
commitd0adeb65c743e01ca3436db1d47a97cdcc78df89 (patch)
tree6754b30c30fe9650b23e76047c08e430921e92c5 /lib/Sema/SemaDeclCXX.cpp
parentf8fc6273ed33386f5081f5cd5d30abd339eec030 (diff)
Simplify checking for whether we should implicitly declare special members and
add some assertions. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index e98f75ebe6..e950f3eb09 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/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;