Swift: remove Binding<> class

That class was meant to allow aggregate initialization of generated
C++ entries having the label `id` as first argument.

As aggregate initialization turned out to be undesirable (names of
fields are not explicit, and `{}` must be inserted for empty
superclasses), this commit removes it and disallows aggregate
initialization altogether by defining empty constructors for generated
classes.
This commit is contained in:
Paolo Tranquilli
2022-05-24 12:49:42 +02:00
parent 9231013401
commit 86b4f16b3a
2 changed files with 6 additions and 6 deletions

View File

@@ -13,7 +13,12 @@
namespace {{namespace}} {
{{#classes}}
struct {{name}}{{#final}} : Binding<{{name}}Tag>{{#bases}}, {{ref.name}}{{/bases}}{{/final}}{{^final}}{{#has_bases}}: {{#bases}}{{^first}}, {{/first}}{{ref.name}}{{/bases}}{{/has_bases}}{{/final}} {
struct {{name}}{{#has_bases}} : {{#bases}}{{^first}}, {{/first}}{{ref.name}}{{/bases}}{{/has_bases}} {
{{name}}() {}
{{#final}}
{{trap_affix}}Label<{{name}}Tag> id{};
{{/final}}
{{#fields}}
{{type}} {{field_name}}{};
{{/fields}}

View File

@@ -58,11 +58,6 @@ inline auto trapQuoted(const std::string& s) {
return std::quoted(s, '"', '"');
}
template <typename Tag>
struct Binding {
TrapLabel<Tag> id;
};
} // namespace codeql
namespace std {