After a new alias is added, any internal aliases among the aliases' underlying types are immediately resolved; an alias then becomes recursive only if it refers to its own name. Bindgen now reports recursive aliases on addition, including loops and indirect recursions like T -> const T * or std::vector<T>. Alias resolution for user types is also faster, since type substitution occurs exactly once (in TypeDatabase#resolve_aliases).
For this to work correctly across various scenarios, even more Parser::Type objects have their full type names canonicalized:
#template always refers to the type name's template arguments. Before this PR, the Clang parser would report types like std::string that don't have a template argument list, but whose #template refers to the underlying template specialization (in this case std::basic_string complete with the char traits and allocator).
CrystalProc is always represented by templated types. The types section of the YAML config is not prepared to handle generic types, so CrystalProc's special passing rules are done in the source code itself.
Some built-in type rules have been replaced by aliases, e.g. qreal to float or double.
I think having CrystalProc added programatically is fine, it requires a lot of special treatment after all. And I think it'll stay the only that needs it for a long time (or forever).
Improves alias resolution of type names.
After a new alias is added, any internal aliases among the aliases' underlying types are immediately resolved; an alias then becomes recursive only if it refers to its own name. Bindgen now reports recursive aliases on addition, including loops and indirect recursions like
T
->const T *
orstd::vector<T>
. Alias resolution for user types is also faster, since type substitution occurs exactly once (inTypeDatabase#resolve_aliases
).For this to work correctly across various scenarios, even more
Parser::Type
objects have their full type names canonicalized:#template
always refers to the type name's template arguments. Before this PR, the Clang parser would report types likestd::string
that don't have a template argument list, but whose#template
refers to the underlying template specialization (in this casestd::basic_string
complete with the char traits and allocator).CrystalProc
is always represented by templated types. Thetypes
section of the YAML config is not prepared to handle generic types, soCrystalProc
's special passing rules are done in the source code itself.qreal
tofloat
ordouble
.