diff --git a/src/AST/TypeExtensions.cs b/src/AST/TypeExtensions.cs index 35efbe0f..5a0ad6e4 100644 --- a/src/AST/TypeExtensions.cs +++ b/src/AST/TypeExtensions.cs @@ -134,11 +134,19 @@ return decl != null; } - var templatedClass = ((ClassTemplate) type.Template).TemplatedClass; - decl = templatedClass.CompleteDeclaration == null - ? templatedClass as T - : (T) templatedClass.CompleteDeclaration; - return decl != null; + var classTemplate = type.Template as ClassTemplate; + if (classTemplate != null) + { + var templatedClass = classTemplate.TemplatedClass; + decl = templatedClass.CompleteDeclaration == null + ? templatedClass as T + : (T) templatedClass.CompleteDeclaration; + return decl != null; + } + + var templateTemplateParameter = type.Template as TemplateTemplateParameter; + if (templateTemplateParameter != null) + return (decl = templateTemplateParameter.TemplatedDecl as T) != null; } tagType = (TagType) type.Desugared; } diff --git a/tests/Common/Common.h b/tests/Common/Common.h index 2fa25baf..40ed1a9d 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -1154,3 +1154,9 @@ struct _Aligned<_Len, char> }; typedef _Aligned<16, char>::type type; + +template class InteriorRings = SpecialisesVoid> +struct polygon +{ + InteriorRings interior_rings; +};