aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/DeclCXX.h
diff options
context:
space:
mode:
authorSean Hunt <scshunt@csclub.uwaterloo.ca>2011-05-11 22:34:38 +0000
committerSean Hunt <scshunt@csclub.uwaterloo.ca>2011-05-11 22:34:38 +0000
commitcdee3fee8ca4df7fb9179f29cc3ba96ac4fd0f95 (patch)
tree9d86f43d739eac08f4290ac8d1563ea609d83ef1 /include/clang/AST/DeclCXX.h
parent83e0995105222b078a57e1e20ef71fbfd0f67d3d (diff)
Implement implicit deletion of default constructors.
Yes, I'm aware that the diagnostics are awful. Tests to follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131203 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/DeclCXX.h')
-rw-r--r--include/clang/AST/DeclCXX.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h
index 72340b357b..47308b4ccd 100644
--- a/include/clang/AST/DeclCXX.h
+++ b/include/clang/AST/DeclCXX.h
@@ -436,9 +436,9 @@ class CXXRecordDecl : public RecordDecl {
/// already computed and are available.
bool ComputedVisibleConversions : 1;
- /// \brief Whether we have already declared the default constructor or
- /// do not need to have one declared.
- bool NeedsImplicitDefaultConstructor : 1;
+ /// \brief Whether we have a C++0x user-provided default constructor (not
+ /// explicitly deleted or defaulted.
+ bool UserProvidedDefaultConstructor : 1;
/// \brief Whether we have already declared the default constructor.
bool DeclaredDefaultConstructor : 1;
@@ -675,12 +675,13 @@ public:
return data().FirstFriend != 0;
}
- /// \brief Determine whether this class has had its default constructor
- /// declared implicitly or does not need one declared implicitly.
+ /// \brief Determine if we need to declare a default constructor for
+ /// this class.
///
/// This value is used for lazy creation of default constructors.
bool needsImplicitDefaultConstructor() const {
- return data().NeedsImplicitDefaultConstructor;
+ return !data().UserDeclaredConstructor &&
+ !data().DeclaredDefaultConstructor;
}
/// hasConstCopyConstructor - Determines whether this class has a
@@ -710,6 +711,12 @@ public:
return data().UserDeclaredConstructor;
}
+ /// hasUserProvidedDefaultconstructor - Whether this class has a
+ /// user-provided default constructor per C++0x.
+ bool hasUserProvidedDefaultConstructor() const {
+ return data().UserProvidedDefaultConstructor;
+ }
+
/// hasUserDeclaredCopyConstructor - Whether this class has a
/// user-declared copy constructor. When false, a copy constructor
/// will be implicitly declared.