2.085-beta / nightly regression uda inside union breaks default initialization

Basile B. b2.temp at gmx.com
Sat Feb 16 13:39:22 UTC 2019


On Saturday, 16 February 2019 at 13:32:12 UTC, Juraj Mojzis wrote:
> Hi,
> i would like to report an issue here, as I'm unable to create 
> an account on Bugzilla.
>
> ---
> import std.stdio;
> struct V4_UDA(T) {
>     enum N = 4;
>
>     union {
>         @("BRAKE_ME") T[N] v = 0;
>         struct { T x, y, z, w; }
>     }
>
>     this(T vx, T vy, T vz, T vw) {
>         x = vx; y = vy; z = vz; w = vw;
>     }
> }
>
>
> alias v4_broken = V4_UDA!(float);
>
> struct OMG {
>     v4_broken broken = v4_broken(1.0f, 2.0f, 3.0f, 4.0f);
> }
>
> void main()
> {
>     OMG omg;
>     writeln(omg.broken.v, "!!!");
> }
> ---
>
> prints:
> [0, 0, 0, 0]!!!
>
>
> run.dlang.io:
> https://run.dlang.io/is/aXXYWH

Because of a IRC #d discussion:

Note that Juraj Mojzis was not able to post the bug report on 
bugzilla because his email host is banned or something. So the 
point of the post is

1. Someone can create the bug report
2. Maybe the test can be minimized
3. Maybe someone can make a fix to avoid that the regression got 
shipped in 2.085


More information about the Digitalmars-d mailing list