mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
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:
@@ -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}}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user