Browse Source

Fixed the parsing of fields with a template template parameter type.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/661/head
Dimitar Dobrev 10 years ago
parent
commit
86bd7340e2
  1. 18
      src/AST/TypeExtensions.cs
  2. 6
      tests/Common/Common.h

18
src/AST/TypeExtensions.cs

@ -134,11 +134,19 @@ @@ -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;
}

6
tests/Common/Common.h

@ -1154,3 +1154,9 @@ struct _Aligned<_Len, char> @@ -1154,3 +1154,9 @@ struct _Aligned<_Len, char>
};
typedef _Aligned<16, char>::type type;
template <typename T, template <typename> class InteriorRings = SpecialisesVoid>
struct polygon
{
InteriorRings<T> interior_rings;
};

Loading…
Cancel
Save