summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg/pr100882a.d
blob: de92ab3bef1bc1e2f11f7d0af0f8fc3fcc6b1ffb (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
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100882
// { dg-do compile }

struct AllocatorList(Factory)
{
    Factory factory;
    auto make(size_t n) { return factory(n); }
    this(Factory plant)
    {
        factory = plant;
    }
}

struct Region
{
    ~this()
    {
    }
}

auto mmapRegionList()
{
    struct Factory
    {
        this(size_t )
        {
        }
        auto opCall(size_t )
        {
            return Region();
        }
    }
    auto shop = Factory();
    AllocatorList!Factory(shop);
}