diff options
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 113003fd442..f1a02c48dd1 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -587,6 +587,8 @@ void Sema::InstantiateFunctionDefinition(FunctionDecl *Function) { // FIXME: add to the instantiation stack. + ActOnStartOfFunctionDef(0, DeclPtrTy::make(Function)); + // Introduce a new scope where local variable instantiations will be // recorded. LocalInstantiationScope Scope(*this); @@ -605,10 +607,9 @@ void Sema::InstantiateFunctionDefinition(FunctionDecl *Function) { // Instantiate the function body. OwningStmtResult Body = InstantiateStmt(Pattern, getTemplateInstantiationArgs(Function)); - if (Body.isInvalid()) - Function->setInvalidDecl(true); - else - Function->setBody(Body.takeAs<Stmt>()); + + ActOnFinishFunctionBody(DeclPtrTy::make(Function), move(Body), + /*IsInstantiation=*/true); CurContext = PreviousContext; } |