]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/test19176.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / test19176.d
1 /*
2 REQUIRED_ARGS: -unittest
3 TEST_OUTPUT:
4 ---
5 fail_compilation/test19176.d(13): Error: argument `foo()` to __traits(getUnitTests) must be a module or aggregate, not a template
6 ---
7 */
8
9 // https://issues.dlang.org/show_bug.cgi?id=19176
10
11 void main()
12 {
13 __traits(getUnitTests, foo);
14 }
15
16 template foo()
17 {
18 static if(true)
19 {
20 enum bar;
21 }
22 else
23 {
24 enum bar;
25 }
26 }