summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/test19176.d
blob: ceceb74c9cba20b61084cac712c2e67bc7575f4c (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
/*
REQUIRED_ARGS: -unittest
TEST_OUTPUT:
---
fail_compilation/test19176.d(13): Error: argument `foo()` to __traits(getUnitTests) must be a module or aggregate, not a template
---
*/

// https://issues.dlang.org/show_bug.cgi?id=19176

void main()
{
    __traits(getUnitTests, foo);
}

template foo()
{
    static if(true)
    {
        enum bar;
    }
    else
    {
        enum bar;
    }
}