mrdocs
mrdocs copied to clipboard
Handle union-like classes
Consider the following:
struct S
{
union
{
short x;
long y;
};
};
Currently, we produce the following output:
<namespace name="">
<struct name="S" id="pOYGF6pLJlICuiGO0Xj0daDb/to=">
<file path="input.cpp" line="20" class="def"/>
<data name="" type="" id="oYkHFJ3A7o+2VVIq/RVlpFvwiWE="/>
<union name="" id="oYkHFJ3A7o+2VVIq/RVlpFvwiWE=">
<file path="input.cpp" line="22" class="def"/>
<data name="x" type="short"/>
<data name="y" type="long"/>
</union>
</struct>
</namespace>
The members x and y should be considered (variant) members of S.
We might want to squelch the name="" since it is empty. @evanlenz what do you think?
Within the DeclContext of S, x and y are IndirectFieldDecls