Hi. I am using IDAClang to parse a templated class and it looks like it compiles successfully but misses a field in one of the structures. On 9.0.240925. I’ve got a minimal reproduceable case here:
template <typename T>
class TemplateTest
{
struct SubStruct
{
T subval1;
};
SubStruct *s_Dummy;
};
volatile TemplateTest<int> asd;
Like I said this compiles fine but TemplateTest::SubStruct is empty and missing subval1, attached.
AST output is like so:
IDACLANG: template C:\dev\bilbo\test.txt:1 kind=ClassTemplate(31) name=TemplateTest type=(0) sizeof=-1
IDACLANG: var C:\dev\bilbo\test.txt:12 kind=VarDecl(9) name=asd type=volatile TemplateTest<int>(119) sizeof=0x8
IDACLANG: class C:\dev\bilbo\test.txt:1 kind=ClassDecl(4) name=TemplateTest type=TemplateTest<int>(105) sizeof=0x8 definition=1 align=8 (required=0 packed=0 packalign=0) vptr=0
IDACLANG: field C:\dev\bilbo\test.txt:9 kind=FieldDecl(6) name=s_Dummy type=SubStruct *(101) sizeof=0x8 offset=0x0 fda=0 packed=0
IDACLANG: struct C:\dev\bilbo\test.txt:4 kind=StructDecl(2) name=SubStruct type=TemplateTest<int>::SubStruct(105) sizeof=-2 definition=0 align=-2 (required=0 packed=0 packalign=0)
IDACLANG: attribute C:\dev\bilbo\test.txt:9 kind=TypeRef(43) name=struct TemplateTest<int>::SubStruct type=TemplateTest<int>::SubStruct(105) sizeof=-2
C:\dev\test.txt: successfully compiled
I’ve also tried to pass a few flags to no avail:
-g -O0 -fno-eliminate-unused-debug-types -fstandalone-debug -fno-discard-value-names -fdelayed-template-parsing
I’m not sure if this is a bug or if I’m missing something. Would appreciate some assistance please. Thanks.