]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/diag11727.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / diag11727.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag11727.d(10): Error: type `n` is not an expression
5 ---
6 */
7 auto returnEnum()
8 {
9 enum n;
10 return n;
11 }
12 void main()
13 {
14 assert(returnEnum() == 0);
15 }
16
17 /*
18 TEST_OUTPUT:
19 ---
20 fail_compilation/diag11727.d(26): Error: type `void` is not an expression
21 ---
22 */
23 auto returnVoid()
24 {
25 alias v = void;
26 return v;
27 }
28
29 /*
30 TEST_OUTPUT:
31 ---
32 fail_compilation/diag11727.d(38): Error: template `t()` has no type
33 ---
34 */
35 auto returnTemplate()
36 {
37 template t() {}
38 return t;
39 }