]> granicus.if.org Git - clang/commitdiff
Add a method to query whether or not a class has a default constructor declared.
authorNick Lewycky <nicholas@mxc.ca>
Thu, 12 May 2011 22:11:21 +0000 (22:11 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Thu, 12 May 2011 22:11:21 +0000 (22:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131255 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclCXX.h

index 47308b4ccdea5ce3943f8faec10fd0c2378a9034..b193b9a18ee4047f412dc6c0de075d94042b5939 100644 (file)
@@ -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;