From 5762c0bec6b73a7f6360a71b94b07b7ba0e4b5e8 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Thu, 12 May 2011 22:11:21 +0000 Subject: [PATCH] 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 --- include/clang/AST/DeclCXX.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.40.0