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
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 6f65288..09e32f7 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -2332,14 +2332,14 @@
//
// This check comes when we actually try to perform the
// instantiation.
- if (SpecializationRequiresInstantiation &&
- InstantiateClassTemplateSpecialization(Specialization, true))
- return true;
+ if (SpecializationRequiresInstantiation)
+ InstantiateClassTemplateSpecialization(Specialization, true);
+ else {
+ // Instantiate the members of this class template specialization.
+ InstantiatingTemplate Inst(*this, TemplateLoc, Specialization);
+ InstantiateClassTemplateSpecializationMembers(TemplateLoc, Specialization);
+ }
- // Instantiate the members of this class template specialization.
- InstantiatingTemplate Inst(*this, TemplateLoc, Specialization);
- InstantiateClassTemplateSpecializationMembers(TemplateLoc, Specialization);
-
return DeclPtrTy::make(Specialization);
}