Fix get_instantiation_template() so that it returns the primary template
This commit is contained in:
parent
6c27481fa7
commit
1e50e12742
1 changed files with 8 additions and 1 deletions
|
|
@ -445,7 +445,14 @@ namespace
|
|||
auto decl = clang_getTypeDeclaration(type);
|
||||
auto count = clang_Type_getNumTemplateArguments(clang_getCursorType(decl));
|
||||
if (count > 0 || is_direct_templated(decl))
|
||||
return decl;
|
||||
{
|
||||
auto specialized = clang_getSpecializedCursorTemplate(decl);
|
||||
if (clang_Cursor_isNull(specialized))
|
||||
// is already a template
|
||||
return decl;
|
||||
else
|
||||
return specialized;
|
||||
}
|
||||
else
|
||||
{
|
||||
// look if the templ_name matches a template template parameter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue