summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-15 17:59:04 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-15 17:59:04 +0000
commit67da0d97e6790cc554aa0ca9986ee8651797caaf (patch)
tree3086e239dd27a2699a77f841695f92f6084a797b /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parentf6e9ece5075a5ea007922ef72246470653fade1b (diff)
downloadbcm5719-llvm-67da0d97e6790cc554aa0ca9986ee8651797caaf.tar.gz
bcm5719-llvm-67da0d97e6790cc554aa0ca9986ee8651797caaf.zip
Call ActOnStartOfFunctionDecl/ActOnFinishFunctionBody when
instantiating the definition of a function from a template. llvm-svn: 71869
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp9
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;
}
OpenPOWER on IntegriCloud