return field_begin() == field_end();
}
- /// completeDefinition - Notes that the definition of this type is
- /// now complete.
- virtual void completeDefinition();
+ /// \brief Indicates that the definition of this class is now complete.
+ void completeDefinition();
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classof(const RecordDecl *D) { return true; }
void markedVirtualFunctionPure();
friend void FunctionDecl::setPure(bool);
+ void completeDefinitionImpl(CXXFinalOverriderMap *FinalOverriders);
+ friend class RecordDecl;
+
protected:
CXXRecordDecl(Kind K, TagKind TK, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
return (PathAccess > DeclAccess ? PathAccess : DeclAccess);
}
- /// \brief Indicates that the definition of this class is now complete.
- virtual void completeDefinition();
-
/// \brief Indicates that the definition of this class is now complete,
/// and provides a final overrider map to help determine
///
return field_iterator(decl_iterator(FirstDecl));
}
-/// completeDefinition - Notes that the definition of this type is now
-/// complete.
-void RecordDecl::completeDefinition() {
- assert(!isDefinition() && "Cannot redefine record!");
- TagDecl::completeDefinition();
-}
-
void RecordDecl::LoadFieldsFromExternalStorage() const {
ExternalASTSource *Source = getASTContext().getExternalSource();
assert(hasExternalLexicalStorage() && Source && "No external storage?");
llvm::tie(FirstDecl, LastDecl) = BuildDeclChain(Decls);
}
+void RecordDecl::completeDefinition() {
+ assert(!isDefinition() && "Cannot redefine record!");
+ TagDecl::completeDefinition();
+ if (CXXRecordDecl *CXXRecord = dyn_cast<CXXRecordDecl>(this))
+ CXXRecord->completeDefinitionImpl(0);
+}
+
//===----------------------------------------------------------------------===//
// BlockDecl Implementation
//===----------------------------------------------------------------------===//
return Dtor;
}
-void CXXRecordDecl::completeDefinition() {
- completeDefinition(0);
-}
-
-void CXXRecordDecl::completeDefinition(CXXFinalOverriderMap *FinalOverriders) {
- RecordDecl::completeDefinition();
-
+void
+CXXRecordDecl::completeDefinitionImpl(CXXFinalOverriderMap *FinalOverriders) {
// If the class may be abstract (but hasn't been marked as such), check for
// any pure final overriders.
if (mayBeAbstract()) {
data().Conversions.setAccess(I, (*I)->getAccess());
}
+void
+CXXRecordDecl::completeDefinition(CXXFinalOverriderMap *FinalOverriders) {
+ TagDecl::completeDefinition();
+ completeDefinitionImpl(FinalOverriders);
+}
+
bool CXXRecordDecl::mayBeAbstract() const {
if (data().Abstract || isInvalidDecl() || !data().Polymorphic ||
isDependentContext())