diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-15 17:59:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-15 17:59:04 +0000 |
commit | e2c31ff0bc622e6fd7d47d7e08b53840f3be6c89 (patch) | |
tree | 4c9ea00c55f5164b5db73832a702b744401a7561 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 7a0ba875a7dcee94ec74fa79b7f8a247d200a76c (diff) |
Call ActOnStartOfFunctionDecl/ActOnFinishFunctionBody when
instantiating the definition of a function from a template.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71869 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 113003fd44..f1a02c48dd 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/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; } |