From: Anders Carlsson Date: Sat, 26 Sep 2009 03:24:57 +0000 (+0000) Subject: Change isTemplate to return the actual template declaration. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb36ba488b7c6185546f8696447530ebfd296df7;p=clang Change isTemplate to return the actual template declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82839 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index 9766e585ff..f03f029198 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -252,13 +252,13 @@ static bool isStdNamespace(const DeclContext *DC) { return NS->getOriginalNamespace()->getIdentifier()->isStr("std"); } -static const NamedDecl *isTemplate(const NamedDecl *ND, - const TemplateArgumentList *&TemplateArgs) { +static const TemplateDecl * +isTemplate(const NamedDecl *ND, const TemplateArgumentList *&TemplateArgs) { // Check if we have a function template. if (const FunctionDecl *FD = dyn_cast(ND)){ - if (FD->getPrimaryTemplate()) { + if (const TemplateDecl *TD = FD->getPrimaryTemplate()) { TemplateArgs = FD->getTemplateSpecializationArgs(); - return FD; + return TD; } } @@ -266,7 +266,7 @@ static const NamedDecl *isTemplate(const NamedDecl *ND, if (const ClassTemplateSpecializationDecl *Spec = dyn_cast(ND)) { TemplateArgs = &Spec->getTemplateArgs(); - return Spec; + return Spec->getSpecializedTemplate(); } return 0;