]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/compilable/compile1.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / compile1.d
1 // COMPILABLE_MATH_TEST
2 // PERMUTE_ARGS:
3 // EXTRA_FILES: imports/a12506.d
4 /* TEST_OUTPUT:
5 ---
6 compilable/compile1.d(229): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
7 ---
8 */
9
10 /***************************************************/
11 // https://issues.dlang.org/show_bug.cgi?id=1748
12 // class template with stringof
13
14 struct S1748(T) {}
15 static assert(S1748!int.stringof == "S1748!int");
16
17 class C1748(T) {}
18 static assert(C1748!int.stringof == "C1748!int");
19
20 /***************************************************/
21 // https://issues.dlang.org/show_bug.cgi?id=2354
22 // pragma + single semicolon DeclarationBlock
23
24 version(all)
25 pragma(inline, true);
26 else
27 pragma(inline, false);
28
29 /***************************************************/
30 // https://issues.dlang.org/show_bug.cgi?id=2438
31
32 alias void delegate() Dg2438;
33
34 alias typeof(Dg2438.ptr) CP2438a;
35 alias typeof(Dg2438.funcptr) FP2438a;
36 static assert(is(CP2438a == void*));
37 static assert(is(FP2438a == void function()));
38
39 alias typeof(Dg2438.init.ptr) CP2438b;
40 alias typeof(Dg2438.init.funcptr) FP2438b;
41 static assert(is(CP2438b == void*));
42 static assert(is(FP2438b == void function()));
43
44 /***************************************************/
45 // https://issues.dlang.org/show_bug.cgi?id=4225
46
47 struct Foo4225
48 {
49 enum x = Foo4225();
50
51 static Foo4225 opCall()
52 {
53 return Foo4225.init;
54 }
55 }
56
57 /***************************************************/
58 // https://issues.dlang.org/show_bug.cgi?id=5996
59 // ICE(expression.c)
60
61 template T5996(T)
62 {
63 auto bug5996() {
64 if (anyOldGarbage) {}
65 return 2;
66 }
67 }
68 static assert(!is(typeof(T5996!(int).bug5996())));
69
70 /***************************************************/
71 // https://issues.dlang.org/show_bug.cgi?id=8532
72 // segfault(mtype.c) - type inference + pure
73
74 auto segfault8532(Y, R ...)(R r, Y val) pure
75 { return segfault8532(r, val); }
76
77 static assert(!is(typeof( segfault8532(1,2,3))));
78
79 /***************************************************/
80 // https://issues.dlang.org/show_bug.cgi?id=8982
81 // ICE(ctfeexpr.c) __parameters with error in default value
82
83 template ice8982(T)
84 {
85 void bug8982(ref const int v = 7){}
86
87 static if (is(typeof(bug8982) P == __parameters)) {
88 enum eval8982 = ((P[0..1] g) => g[0])();
89 }
90 }
91
92 static assert(!is(ice8982!(int)));
93
94
95 /***************************************************/
96 // https://issues.dlang.org/show_bug.cgi?id=8801
97 // ICE assigning to __ctfe
98
99 static assert(!is(typeof( { bool __ctfe= true; })));
100 static assert(!is(typeof( { __ctfe |= true; })));
101
102 /***************************************************/
103 // https://issues.dlang.org/show_bug.cgi?id=5932
104 // https://issues.dlang.org/show_bug.cgi?id=6675
105 // ICE(s2ir.c), ICE(glue.c)
106
107 void bug3932(T)() {
108 static assert( 0 );
109 func5932( 7 );
110 }
111
112 void func5932(T)( T val ) {
113 void onStandardMsg() {
114 foreach( t; T ) { }
115 }
116 }
117
118 static assert(!is(typeof(
119 {
120 bug3932!(int)();
121 }()
122 )));
123
124 /***************************************************/
125 // https://issues.dlang.org/show_bug.cgi?id=6650
126 // ICE(glue.c) or wrong-code
127
128 auto bug6650(X)(X y)
129 {
130 X q;
131 q = "abc";
132 return y;
133 }
134
135 static assert(!is(typeof(bug6650!(int)(6))));
136 static assert(!is(typeof(bug6650!(int)(18))));
137
138 /***************************************************/
139 // https://issues.dlang.org/show_bug.cgi?id=14710
140 // VC-built DMD crashes on templated variadic function IFTI
141
142 void bug14710a(T)(T val, T[] arr...)
143 {
144 }
145
146 void bug14710b()
147 {
148 bug14710a("", "");
149 }
150
151 /***************************************************/
152 // https://issues.dlang.org/show_bug.cgi?id=6661
153 // Templates instantiated only through is(typeof()) shouldn't cause errors
154
155 template bug6661(Q)
156 {
157 int qutz(Q y)
158 {
159 Q q = "abc";
160 return 67;
161 }
162 static assert(qutz(13).sizeof!=299);
163 const Q blaz = 6;
164 }
165
166 static assert(!is(typeof(bug6661!(int).blaz)));
167
168 template bug6661x(Q)
169 {
170 int qutz(Q y)
171 {
172 Q q = "abc";
173 return 67;
174 }
175 }
176 // should pass, but doesn't in current
177 //static assert(!is(typeof(bug6661x!(int))));
178
179 /***************************************************/
180 // https://issues.dlang.org/show_bug.cgi?id=6599
181 // ICE(constfold.c) or segfault
182
183 string bug6599extraTest(string x) { return x ~ "abc"; }
184
185 template Bug6599(X)
186 {
187 class Orbit
188 {
189 Repository repository = Repository();
190 }
191
192 struct Repository
193 {
194 string fileProtocol = "file://";
195 string blah = bug6599extraTest("abc");
196 string source = fileProtocol ~ "/usr/local/orbit/repository";
197 }
198 }
199
200 static assert(!is(typeof(Bug6599!int)));
201
202 /***************************************************/
203 // https://issues.dlang.org/show_bug.cgi?id=8422
204 // TypeTuple of tuples can't be read at compile time
205
206 template TypeTuple8422(TList...)
207 {
208 alias TList TypeTuple8422;
209 }
210
211 struct S8422 { int x; }
212
213 void test8422()
214 {
215 enum a = S8422(1);
216 enum b = S8422(2);
217 enum c = [1,2,3];
218 foreach(t; TypeTuple8422!(b, a)) {
219 enum u = t;
220 }
221 foreach(t; TypeTuple8422!(c)) {
222 enum v = t;
223 }
224 }
225
226 /***************************************************/
227 // https://issues.dlang.org/show_bug.cgi?id=6096
228 // ICE(el.c) with -O
229
230 cdouble c6096;
231
232 int bug6096()
233 {
234 if (c6096) return 0;
235 return 1;
236 }
237
238 /***************************************************/
239 // https://issues.dlang.org/show_bug.cgi?id=7681
240 // Segfault
241
242 static assert( !is(typeof( (){
243 undefined ~= delegate(){}; return 7;
244 }())));
245
246 /***************************************************/
247 // https://issues.dlang.org/show_bug.cgi?id=8639
248 // Buffer overflow
249
250 void t8639(alias a)() {}
251 void bug8639() {
252 t8639!({auto r = -real.max;})();
253 }
254
255 /***************************************************/
256 // https://issues.dlang.org/show_bug.cgi?id=7751
257 // Segfault
258
259 static assert( !is(typeof( (){
260 bar[]r; r ~= [];
261 return 7;
262 }())));
263
264 /***************************************************/
265 // https://issues.dlang.org/show_bug.cgi?id=7639
266 // Segfault
267
268 static assert( !is(typeof( (){
269 enum foo =
270 [
271 str : "functions",
272 ];
273 })));
274
275 /***************************************************/
276 // https://issues.dlang.org/show_bug.cgi?id=11991
277
278 void main()
279 {
280 int Throwable;
281 int object;
282 try
283 {
284 }
285 catch(.object.Throwable)
286 {
287 }
288 }
289
290 /***************************************************/
291 // https://issues.dlang.org/show_bug.cgi?id=11939
292
293 void test11939()
294 {
295 scope(failure)
296 {
297 import object : Object;
298 }
299 throw new Exception("");
300 }
301
302 /***************************************************/
303 // https://issues.dlang.org/show_bug.cgi?id=5796
304
305 template A(B) {
306 pragma(lib, "missing ;")
307 enum X = 0;
308 }
309
310 static assert(!is(typeof(A!(int))));
311
312 /***************************************************/
313 // https://issues.dlang.org/show_bug.cgi?id=6720
314
315 void bug6720() { }
316
317 static assert(!is(typeof(
318 cast(bool)bug6720()
319 )));
320
321 /***************************************************/
322 // https://issues.dlang.org/show_bug.cgi?id=1099
323
324 template Mix1099(int a) {
325 alias typeof(this) ThisType;
326 static assert (ThisType.init.tupleof.length == 2);
327 }
328
329
330 struct Foo1099 {
331 mixin Mix1099!(0);
332 int foo;
333 mixin Mix1099!(1);
334 int bar;
335 mixin Mix1099!(2);
336 }
337
338 /***************************************************/
339 // https://issues.dlang.org/show_bug.cgi?id=8788
340 // super() and return
341
342 class B8788 {
343 this ( ) { }
344 }
345
346 class C8788(int test) : B8788
347 {
348 this ( int y )
349 { // TESTS WHICH SHOULD PASS
350 static if (test == 1) {
351 if (y == 3) {
352 super();
353 return;
354 }
355 super();
356 return;
357 } else static if (test == 2) {
358 if (y == 3) {
359 super();
360 return;
361 }
362 super();
363 } else static if (test == 3) {
364 if (y > 3) {
365 if (y == 7) {
366 super();
367 return;
368 }
369 super();
370 return;
371 }
372 super();
373 } else static if (test == 4) {
374 if (y > 3) {
375 if (y == 7) {
376 super();
377 return;
378 }
379 else if (y> 5)
380 super();
381 else super();
382 return;
383 }
384 super();
385 }
386 // TESTS WHICH SHOULD FAIL
387 else static if (test == 5) {
388 if (y == 3) {
389 super();
390 return;
391 }
392 return; // no super
393 } else static if (test == 6) {
394 if (y > 3) {
395 if (y == 7) {
396 super();
397 return;
398 }
399 super();
400 }
401 super(); // two calls
402 } else static if (test == 7) {
403 if (y == 3) {
404 return; // no super
405 }
406 super();
407 } else static if (test == 8) {
408 if (y > 3) {
409 if (y == 7) {
410 return; // no super
411 }
412 super();
413 return;
414 }
415 super();
416 } else static if (test == 9) {
417 if (y > 3) {
418 if (y == 7) {
419 super();
420 return;
421 }
422 else if (y> 5)
423 super();
424 else return; // no super
425 return;
426 }
427 super();
428 }
429 }
430 }
431
432 static assert( is(typeof( { new C8788!(1)(0); } )));
433 static assert( is(typeof( { new C8788!(2)(0); } )));
434 static assert( is(typeof( { new C8788!(3)(0); } )));
435 static assert( is(typeof( { new C8788!(4)(0); } )));
436 static assert(!is(typeof( { new C8788!(5)(0); } )));
437 static assert(!is(typeof( { new C8788!(6)(0); } )));
438 static assert(!is(typeof( { new C8788!(7)(0); } )));
439 static assert(!is(typeof( { new C8788!(8)(0); } )));
440 static assert(!is(typeof( { new C8788!(9)(0); } )));
441
442 /***************************************************/
443 // https://issues.dlang.org/show_bug.cgi?id=4967
444 // https://issues.dlang.org/show_bug.cgi?id=7058
445
446 enum Bug7058 bug7058 = { 1.5f, 2};
447 static assert(bug7058.z == 99);
448
449 struct Bug7058
450 {
451 float x = 0;
452 float y = 0;
453 float z = 99;
454 }
455
456
457 /***************************************************/
458
459 void test12094()
460 {
461 auto n = null;
462 int *a;
463 int[int] b;
464 int[] c;
465 auto u = true ? null : a;
466 auto v = true ? null : b;
467 auto w = true ? null : c;
468 auto x = true ? n : a;
469 auto y = true ? n : b;
470 auto z = true ? n : c;
471 a = n;
472 b = n;
473 c = n;
474 }
475
476 /***************************************************/
477
478 template test8163(T...)
479 {
480 struct Point
481 {
482 T fields;
483 }
484
485 enum N = 2; // N>=2 triggers the bug
486 extern Point[N] bar();
487
488 void foo()
489 {
490 Point[N] _ = bar();
491 }
492 }
493
494 alias test8163!(long) _l;
495 alias test8163!(double) _d;
496 alias test8163!(float, float) _ff;
497 alias test8163!(int, int) _ii;
498 alias test8163!(int, float) _if;
499 alias test8163!(ushort, ushort, ushort, ushort) _SSSS;
500 alias test8163!(ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte) _BBBBBBBB;
501 alias test8163!(ubyte, ubyte, ushort, float) _BBSf;
502
503
504 /***************************************************/
505 // https://issues.dlang.org/show_bug.cgi?id=4757
506
507 auto foo4757(T)(T)
508 {
509 static struct Bar(T)
510 {
511 void spam()
512 {
513 foo4757(1);
514 }
515 }
516 return Bar!T();
517 }
518
519 void test4757()
520 {
521 foo4757(1);
522 }
523
524 /***************************************************/
525 // https://issues.dlang.org/show_bug.cgi?id=9348
526
527 void test9348()
528 {
529 @property Object F(int E)() { return null; }
530
531 assert(F!0 !is null);
532 assert(F!0 !in [new Object():1]);
533 }
534
535 /***************************************************/
536 // https://issues.dlang.org/show_bug.cgi?id=9690
537
538 @disable
539 {
540 void dep9690() {}
541 void test9690()
542 {
543 dep9690(); // OK
544 void inner()
545 {
546 dep9690(); // OK <- NG
547 }
548 }
549 }
550
551 /***************************************************/
552 // https://issues.dlang.org/show_bug.cgi?id=9987
553
554 static if (is(object.ModuleInfo == struct))
555 {
556 struct ModuleInfo {}
557
558 static assert(!is(object.ModuleInfo == ModuleInfo));
559 static assert(object.ModuleInfo.sizeof != ModuleInfo.sizeof);
560 }
561 static if (is(object.ModuleInfo == class))
562 {
563 class ModuleInfo {}
564
565 static assert(!is(object.ModuleInfo == ModuleInfo));
566 static assert(__traits(classInstanceSize, object.ModuleInfo) !=
567 __traits(classInstanceSize, ModuleInfo));
568 }
569
570 /***************************************************/
571 // https://issues.dlang.org/show_bug.cgi?id=10158
572
573 class Outer10158
574 {
575 static struct Inner
576 {
577 int f;
578 }
579
580 void test()
581 {
582 static assert( Inner.f .offsetof == 0); // OK <- NG
583 static assert((Inner.f).offsetof == 0); // OK
584 }
585 }
586
587 void test10158()
588 {
589 static assert(Outer10158.Inner.f.offsetof == 0); // OK
590 }
591
592 /***************************************************/
593 // https://issues.dlang.org/show_bug.cgi?id=10326
594
595 class C10326
596 {
597 int val;
598 invariant { assert(val == 0); }
599 invariant() { assert(val == 0); }
600 }
601
602 /***************************************************/
603 // https://issues.dlang.org/show_bug.cgi?id=11042
604
605 static if ((true || error) == true ) {} else { static assert(0); }
606 static if ((false && error) == false) {} else { static assert(0); }
607 static assert ((true || error) == true );
608 static assert ((false && error) == false);
609 int f11042a1()() if ((true || error) == true ) { return 0; } enum x11042a1 = f11042a1();
610 int f11042b1()() if ((false && error) == false) { return 0; } enum x11042b1 = f11042b1();
611
612 static if (is(typeof(true || error)) == false) {} else { static assert(0); }
613 static if (is(typeof(false && error)) == false) {} else { static assert(0); }
614 static assert (is(typeof(true || error)) == false);
615 static assert (is(typeof(false && error)) == false);
616 int f11042a2()() if (is(typeof(true || error)) == false) { return 0; } enum x11042a2 = f11042a2();
617 int f11042b2()() if (is(typeof(false && error)) == false) { return 0; } enum x11042b2 = f11042b2();
618
619 static if (__traits(compiles, true || error) == false) {} else { static assert(0); }
620 static if (__traits(compiles, false && error) == false) {} else { static assert(0); }
621 static assert (__traits(compiles, true || error) == false);
622 static assert (__traits(compiles, false && error) == false);
623 int f11042a3()() if (__traits(compiles, true || error) == false) { return 0; } enum x11042a3 = f11042a3();
624 int f11042b3()() if (__traits(compiles, false && error) == false) { return 0; } enum x11042b3 = f11042b3();
625
626 /***************************************************/
627 // https://issues.dlang.org/show_bug.cgi?id=11554
628
629 enum E11554;
630 static assert(is(E11554 == enum));
631
632 struct Bro11554(N...) {}
633 static assert(!is(E11554 unused : Bro11554!M, M...));
634
635 /***************************************************/
636 // https://issues.dlang.org/show_bug.cgi?id=12302
637
638 template isCallable12302(T...)
639 if (T.length == 1)
640 {
641 static if (is(typeof(& T[0].opCall) == delegate))
642 enum bool isCallable12302 = true;
643 else
644 static if (is(typeof(& T[0].opCall) V : V*) && is(V == function))
645 enum bool isCallable12302 = true;
646 else
647 enum bool isCallable12302 = true;
648 }
649
650 class A12302
651 {
652 struct X {}
653 X x;
654 auto opDispatch(string s, TArgs...)(TArgs args)
655 {
656 mixin("return x."~s~"(args);");
657 }
658 }
659
660 A12302 func12302() { return null; }
661 enum b12302 = isCallable12302!func12302;
662
663 /***************************************************/
664 // https://issues.dlang.org/show_bug.cgi?id=12476
665
666 template A12476(T) { }
667
668 struct S12476(T)
669 {
670 alias B = A12476!T;
671 }
672
673 class C12476(T)
674 {
675 alias B = A12476!T;
676 }
677
678 struct Bar12476(alias Foo)
679 {
680 Foo!int baz;
681 alias baz this;
682 }
683
684 alias Identity12476(alias A) = A;
685
686 alias sb12476 = Identity12476!(Bar12476!S12476.B);
687 alias cb12476 = Identity12476!(Bar12476!C12476.B);
688
689 static assert(__traits(isSame, sb12476, A12476!int));
690 static assert(__traits(isSame, cb12476, A12476!int));
691
692 /***************************************************/
693 // https://issues.dlang.org/show_bug.cgi?id=12506
694
695 import imports.a12506;
696 private bool[9] r12506a = f12506!(i => true)(); // OK
697 private immutable bool[9] r12506b = f12506!(i => true)(); // OK <- error
698
699 /***************************************************/
700 // https://issues.dlang.org/show_bug.cgi?id=12555
701
702 class A12555(T)
703 {
704 Undef12555 error;
705 }
706
707 static assert(!__traits(compiles, {
708 class C : A12555!C { }
709 }));
710
711 /***************************************************/
712 // https://issues.dlang.org/show_bug.cgi?id=11622
713
714 class A11622(T)
715 {
716 B11622!T foo()
717 {
718 return new B11622!T;
719 }
720 }
721
722 class B11622(T) : T
723 {
724 }
725
726 static assert(!__traits(compiles, {
727 class C : A11622!C { }
728 }));
729
730 /***************************************************/
731 // https://issues.dlang.org/show_bug.cgi?id=12688
732
733 void writeln12688(A...)(A) {}
734
735 struct S12688
736 {
737 int foo() @property { return 1; }
738 }
739
740 void test12688()
741 {
742 S12688 s;
743 s.foo.writeln12688; // ok
744 (s.foo).writeln12688; // ok <- ng
745 }
746
747 /***************************************************/
748 // https://issues.dlang.org/show_bug.cgi?id=12703
749
750 struct S12703
751 {
752 this(int) {}
753 }
754
755 final class C12703
756 {
757 S12703 s = S12703(1);
758 }
759
760 /***************************************************/
761 // https://issues.dlang.org/show_bug.cgi?id=12799
762
763 struct A12799
764 {
765 int a;
766 enum C = A12799.sizeof;
767 enum D = C; // OK <- Error
768 }
769
770 /***************************************************/
771 // https://issues.dlang.org/show_bug.cgi?id=13236
772
773 enum bug13286 = is(typeof({ struct S { S x; } }));
774
775 /***************************************************/
776 // https://issues.dlang.org/show_bug.cgi?id=13280
777
778 struct S13280
779 {
780 alias U = ubyte;
781 alias T1 = ubyte[this.sizeof]; // ok
782 alias T2 = const U[this.sizeof]; // ok
783 alias T3 = const ubyte[this.sizeof]; // ok <- error
784 }
785
786 /***************************************************/
787 // https://issues.dlang.org/show_bug.cgi?id=13481
788
789 mixin template Mix13481(void function() callback)
790 {
791 static this()
792 {
793 callback();
794 }
795 }
796
797 /***************************************************/
798 // https://issues.dlang.org/show_bug.cgi?id=13564
799
800 class E13564(T)
801 {
802 int pos;
803 }
804
805 class C13564(T)
806 {
807 struct S
808 {
809 ~this()
810 {
811 C13564!int c;
812 c.element.pos = 0;
813 }
814 }
815
816 E13564!T element;
817 }
818
819 void test13564()
820 {
821 auto c = new C13564!int();
822 }
823
824 /***************************************************/
825 // https://issues.dlang.org/show_bug.cgi?id=14166
826
827 struct Proxy14166(T)
828 {
829 T* ptr;
830 ref deref() { return *ptr; }
831 alias deref this;
832 }
833 struct Test14166
834 {
835 auto opIndex() { return this; }
836 auto opIndex(int) { return 1; }
837 }
838 template Elem14166a(R) { alias Elem14166a = typeof(R.init[][0]); }
839 template Elem14166b(R) { alias Elem14166b = typeof(R.init[0]); }
840 void test14166()
841 {
842 alias T = Proxy14166!Test14166;
843 static assert(is(Elem14166a!T == int)); // rejects-valid case
844 static assert(is(Elem14166b!T == int)); // regression case
845 }
846
847 // other related cases
848 struct S14166
849 {
850 int x;
851 double y;
852 int[] a;
853 S14166 opUnary(string op : "++")() { return this; }
854 }
855 S14166 s14166;
856
857 struct X14166 { this(int) { } X14166 opAssign(int) { return this; } }
858 X14166[int] aa14166;
859 X14166[int] makeAA14166() { return aa14166; }
860
861 struct Tup14166(T...) { T field; alias field this; }
862 Tup14166!(int, int) tup14166;
863 Tup14166!(int, int) makeTup14166() { return tup14166; }
864 alias TT14166(T...) = T;
865
866 static assert(is(typeof((s14166.x += 1) = 2) == int)); // ok <- error
867 static assert(is(typeof(s14166.a.length += 2) == size_t)); // ok <- error
868 static assert(is(typeof(s14166++) == S14166)); // ok <- error
869 static assert(is(typeof(s14166.x ^^ 2) == int)); // ok <- error
870 static assert(is(typeof(s14166.y ^^= 2.5) == double)); // ok <- error
871 static assert(is(typeof(makeAA14166()[0] = 1) == X14166)); // ok <- error
872 static assert(is(typeof(tup14166.field = makeTup14166()) == TT14166!(int, int))); // ok <- error
873
874 /***************************************************/
875 // https://issues.dlang.org/show_bug.cgi?id=14388
876
877 @property immutable(T)[] idup14388(T)(T[] a)
878 {
879 alias U = immutable(T);
880 U[] res;
881 foreach (ref e; a)
882 res ~= e;
883 return res;
884 }
885
886 struct Data14388(A14388 a)
887 {
888 auto foo()
889 {
890 return Data14388!a.init; // [B]
891 }
892 }
893
894 struct A14388
895 {
896 struct Item {}
897
898 immutable(Item)[] items;
899
900 this(int dummy)
901 {
902 items = [Item()].idup14388;
903 }
904 }
905
906 void test14388()
907 {
908 auto test = Data14388!(A14388(42)).init.foo(); // [A]
909 /*
910 * A(42) is interpreter to a struct literal A([immutable(Item)()]).
911 * The internal VarDeclaration with STCmanifest for the Data's template parameteter 'a'
912 * calls syntaxCopy() on its ((ExpInitializer *)init)->exp in VarDeclaration::semantic(),
913 * and 'immutable(Item)()'->syntaxCopy() had incorrectly removed the qualifier.
914 * Then, the arguments of two Data template instances at [A] and [B] had become unmatch,
915 * and the second instantiation had created the AST duplication.
916 */
917 }
918
919 /***************************************************/
920 // https://issues.dlang.org/show_bug.cgi?id=15163
921
922 void function() func15164(int[] arr)
923 {
924 return () { };
925 }
926
927 void test15163()
928 {
929 auto arr = [[0]];
930 func15164(arr[0])();
931 }
932
933 /***************************************************/
934 // https://issues.dlang.org/show_bug.cgi?id=3438
935
936 import core.vararg;
937 struct S3438_1 { this(int x, int y = 1) { } }
938 struct S3438_2 { this(int x, ...) { } }
939 struct S3438_3 { this(int x, int[] arr...) { } }
940 struct S3438_4 { this(...) { } }
941 struct S3438_5 { this(int[] arr...) { } }
942
943 /***************************************************/
944 // https://issues.dlang.org/show_bug.cgi?id=15362
945
946 void func15362()
947 {
948 assert(true);
949 assert(true,);
950 assert(true, "So true");
951 assert(true, "Very, very true",);
952 static assert(true);
953 static assert(true,);
954 static assert(true, "So true");
955 static assert(true, "Very, very true",);
956 }
957
958 /***************************************************/
959 // https://issues.dlang.org/show_bug.cgi?id=15799
960
961 interface I15799
962 {
963 void funA();
964
965 void funB(int n)
966 in {
967 assert(n);
968 }; // Semicolon is not a part of function declaration. It's an empty declaration.
969 }
970
971 /***************************************************/
972 // https://issues.dlang.org/show_bug.cgi?id=21163
973
974 struct B21163
975 {
976 void function(scope int) fp;
977 }
978
979 B21163 b21163 = {
980 (scope int x){}
981 };
982
983 /***************************************************/
984 // https://issues.dlang.org/show_bug.cgi?id=11624
985
986 interface I11624
987 {
988 void foo();
989 }
990
991 static assert(!__traits(compiles,
992 {
993 static class C11624 : I11624 { }
994 }));