diff options
Diffstat (limited to 'include/clang/AST/DeclCXX.h')
-rw-r--r-- | include/clang/AST/DeclCXX.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 7c54901be3..dde0270ce3 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -378,6 +378,10 @@ class CXXRecordDecl : public RecordDecl { /// even if the class has a trivial default constructor. bool HasUninitializedReferenceMember : 1; + /// \brief True if any non-mutable field whose type doesn't have a user- + /// provided default ctor also doesn't have an in-class initializer. + bool HasUninitializedFields : 1; + /// \brief These flags are \c true if a defaulted corresponding special /// member can't be fully analyzed without performing overload resolution. /// @{ @@ -1270,6 +1274,13 @@ public: return !(data().HasTrivialSpecialMembers & SMF_Destructor); } + /// \brief Determine whether declaring a const variable with this type is ok + /// per core issue 253. + bool allowConstDefaultInit() const { + return !data().HasUninitializedFields || + hasUserProvidedDefaultConstructor(); + } + /// \brief Determine whether this class has a destructor which has no /// semantic effect. /// |