]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/ice14621.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / ice14621.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice14621.d(22): Error: static assert: `false` is false
5 fail_compilation/ice14621.d(28): instantiated from here: `erroneousTemplateInstantiation!()`
6 ---
7 */
8
9 void main()
10 {
11 S s;
12 s.foo();
13 }
14
15 struct S
16 {
17 float[] array;
18 alias array this;
19
20 template erroneousTemplateInstantiation()
21 {
22 static assert(false);
23 }
24
25 void foo()
26 {
27 S ret;
28 ret[] = erroneousTemplateInstantiation!();
29 }
30 }