aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-05-12 22:11:21 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-05-12 22:11:21 +0000
commit5762c0bec6b73a7f6360a71b94b07b7ba0e4b5e8 (patch)
tree265af804344e89bf357da531b8d425ed1fd3361f
parent96b69a7305e20c98f1a3e2e7cd52e2d6c5d53835 (diff)
Add a method to query whether or not a class has a default constructor declared.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131255 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/DeclCXX.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h
index 47308b4ccd..b193b9a18e 100644
--- a/include/clang/AST/DeclCXX.h
+++ b/include/clang/AST/DeclCXX.h
@@ -437,7 +437,7 @@ class CXXRecordDecl : public RecordDecl {
bool ComputedVisibleConversions : 1;
/// \brief Whether we have a C++0x user-provided default constructor (not
- /// explicitly deleted or defaulted.
+ /// explicitly deleted or defaulted).
bool UserProvidedDefaultConstructor : 1;
/// \brief Whether we have already declared the default constructor.
@@ -684,6 +684,12 @@ public:
!data().DeclaredDefaultConstructor;
}
+ /// hasDeclaredDefaultConstructor - Whether this class's default constructor
+ /// has been declared (either explicitly or implicitly).
+ bool hasDeclaredDefaultConstructor() const {
+ return data().DeclaredDefaultConstructor;
+ }
+
/// hasConstCopyConstructor - Determines whether this class has a
/// copy constructor that accepts a const-qualified argument.
bool hasConstCopyConstructor(const ASTContext &Context) const;