atilaneves / dpp

Directly include C headers in D source code
Boost Software License 1.0
230 stars 31 forks source link

Don't generate accessor functions when declaring a const anonymous struct as a field #216

Closed cbecerescu closed 4 years ago

cbecerescu commented 4 years ago

Previously, for this code

struct A {
    const struct {
        int version;
        int other;
    } version;
};

dpp would declare a 'const(_Anonymous0) version_;' field inside struct A, along with accessors for the _Anonymous_0 struct (i.e. auto version()). This would result in name clashes. But, anyway, there is no need to define accessors as we already have a named field through which we can modify (in this case just at initialization, because of the const) the field of type _Anonymous_0.