aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/runnable/complex3.d
blob: 7167b0b6ff8749b821a658a26a669538ddc54de3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// https://issues.dlang.org/show_bug.cgi?id=23778


enum __c_long_double : double;

alias __c_long_double c_long_double;

struct _Complex
{
    c_long_double re;
    c_long_double im;
}

version (all) // bug to test
{
    enum __c_complex_real   : _Complex;
    alias c_complex_real = __c_complex_real;
}
else // works
    enum c_complex_real   : _Complex;

c_complex_real toNative2(real re, real im)
{
    return c_complex_real(re, im);
}

void main()
{
    c_complex_real n = toNative2(123, 456);
    assert(123 == n.re && 456 == n.im);
}