aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg/pr96301c.d
blob: c90946250160a5d0e884b3f013c61b2ac7f562d1 (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
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96301
// { dg-additional-options "-fPIC" { target fpic } }
// { dg-do compile }
class Container
{
    int[] children;

    void remove(void* data)
    {
        int[] remove(int[] range)
        {
            auto result = range;
            if (result.front)
                return result;
            assert(0);
        }
        if (data)
            remove(children);
    }
}

int front(int[] a)
{
    return a.ptr[0];
}