aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg/gdc212.d
blob: 417c1fc8f54220db63695928863b5cee9e9a0690 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// https://bugzilla.gdcproject.org/show_bug.cgi?id=212
// { dg-do compile }

template hasElaborateAssign212(S)
{
    enum hasElaborateAssign212 = is(typeof(S.init.opAssign(rvalueOf212!S))) ||
        is(typeof(lvalueOf212!S)) ;
}

T rvalueOf212(T)();

T lvalueOf212(T)();


template TypeTuple212(TList...)
{
    alias TypeTuple212 = TList;
}

template Tuple212()
{
    struct Tuple212
    {
        void opAssign(R)(R)
        {
            if (hasElaborateAssign212!R)
            {
            }
        }
    }
}

ref emplaceRef212()
{
    static if (!hasElaborateAssign212!(Tuple212!()))
        chunk;
}

class TaskPool212
{
    void reduce()
    {
        Tuple212!() seed = void;
        Tuple212!()[] results;
        foreach(i; TypeTuple212!(0, 1))
            results[i] = seed;
    }
}