microsoft / ifc-spec

IFC format specification
Creative Commons Attribution 4.0 International
71 stars 7 forks source link

Divergence between placeholder-type definition in the specification and .ifc produced by MSVC #13

Closed AndreyG closed 2 years ago

AndreyG commented 2 years ago

According to the definition of placeholder-type-structure (sec:ifc:TypeSort:Placeholder) its sizeof should be equal 8, but entry_size in the partition "type.placeholder" produced by MSVC (IFC-version 0.40) is equal to 12.

cdacamar commented 2 years ago

There is an extra member in this structure known as the 'elaboration' (what the placeholder was deduced to). This elaboration field appears after basis and is a TypeIndex.

cc @GabrielDosReis

AndreyG commented 2 years ago

@cdacamar, thanks. Do I understand correctly, that elaboration could be null for dependent (1) or undeducible (2) type?

template<typename T>
/* #1 */ auto f() { return T::foo(); }

/* #2 */ auto g(); // #2
cdacamar commented 2 years ago

In both cases the elaboration field would be null.