microsoft/ifc-spec

Divergence between template-decl definition in the specification and .ifc produced by MSVC

Closed this issue · 3 comments

According to the definition of template-decl-structure (sec:ifc:DeclSort:Template) its sizeof should be equal 40, but entry_size in the partition "decl.template" produced by MSVC (IFC-version 0.33) is equal to 44. Maybe uint32_t padding-or-reserved; should be added to the end of template-decl-structure?

in the partition "decl.template" produced by MSVC (IFC-version 0.33) is equal to 44

Which version of the MSVC compiler are you using? Make sure you use an MSVC compiler that reports IFC version 0.40 -- the same as the version in this document.

I have updated MSVC to the latest available version 19.30.30705 and IFC-version is 0.40 now, but entry_size in the partition "decl.template" is still equal to 44.

Here's the sum I come up with:

TemplateDecl:

  • NameIndex -> 4 bytes
  • SourceLocation -> 8 bytes
  • DeclIndex -> 4 bytes
  • ChartIndex -> 4 bytes
  • ParameterizedEntity
    • DeclIndex -> 4 bytes
    • SentenceIndex -> 4 bytes
    • SentenceIndex -> 4 bytes
    • SentenceIndex -> 4 bytes
  • BasicSpecifiers -> 1 byte
  • Access -> 1 byte
  • ReachableProperties -> 1 byte
  • (padding) -> 1 byte

Sum: 40.

@GabrielDosReis it appears as if we're missing the template decl 'type' field in the documentation. It should appear immediately after the parameterized entity block.