When declaring a function template, create a FunctionTemplateDecl node
and associate it with the FunctionDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74028 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 26e5673..4ecb44c 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -67,9 +67,10 @@
}
}
- // FIXME: What follows is a gross hack.
+ // FIXME: What follows is a slightly less gross hack than what used to
+ // follow.
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(IIDecl)) {
- if (FD->getType()->isDependentType()) {
+ if (FD->getDescribedFunctionTemplate()) {
TemplateResult = TemplateTy::make(FD);
return TNK_Function_template;
}
@@ -78,7 +79,7 @@
for (OverloadedFunctionDecl::function_iterator F = Ovl->function_begin(),
FEnd = Ovl->function_end();
F != FEnd; ++F) {
- if ((*F)->getType()->isDependentType()) {
+ if ((*F)->getDescribedFunctionTemplate()) {
TemplateResult = TemplateTy::make(Ovl);
return TNK_Function_template;
}