When in C++, invoke ASTConsumer::HandleTagDeclDefinition in Sema::ActOnFinishCXXClassDef,
at which point the C++ struct/class/union is fully parsed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54569 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 87efe2b..554e742 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -13,6 +13,7 @@
#include "Sema.h"
#include "clang/Basic/LangOptions.h"
+#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/Expr.h"
@@ -469,11 +470,13 @@
}
void Sema::ActOnFinishCXXClassDef(DeclTy *D) {
- Decl *Dcl = static_cast<Decl *>(D);
- assert(isa<CXXRecordDecl>(Dcl) &&
- "Invalid parameter, expected CXXRecordDecl");
+ CXXRecordDecl *Rec = cast<CXXRecordDecl>(static_cast<Decl *>(D));
FieldCollector->FinishClass();
PopDeclContext();
+
+ // Everything, including inline method definitions, have been parsed.
+ // Let the consumer know of the new TagDecl definition.
+ Consumer.HandleTagDeclDefinition(Rec);
}
//===----------------------------------------------------------------------===//