1 // 1537 2 foo(char[]s)3void foo(char[] s) 4 { 5 int x = -1; 6 7 while (s.length) 8 { 9 char c = s[0]; 10 11 if (c == '}') 12 break; 13 14 assert (c >= '0' && c <= '9', s[0..$]); 15 16 if (x == -1) 17 x = 0; 18 } 19 } 20 21 /**************************************/ 22 23 enum bug4732 = 42; 24 static assert( __traits(identifier, bug4732) == "bug4732"); 25 26 /**************************************/ 27 Compileable(int z)28template Compileable(int z) { bool OK=true;} 29 bug5245a(U)30int bug5245a(U)() 31 { 32 { enum T { a = 5 } T v; } 33 { enum T { a = 6 } T w; } 34 return 91; 35 } 36 bug5245b(U)37int bug5245b(U)() 38 { 39 { struct T { int a = 2; } T v; } 40 { union T { int a = 3; } T w; } 41 return 91; 42 } 43 bug5245c(U)44int bug5245c(U)() 45 { 46 { struct T { int a = 2; } T v; } 47 { class T { int a = 3; } T w; } 48 return 91; 49 } 50 bug5245d(U)51int bug5245d(U)() 52 { 53 { enum T { a = 3 } T w; } 54 { struct T { int a = 2; } T v; } 55 return 91; 56 } 57 58 59 static assert(!is(typeof(Compileable!(bug5245a!(int)()).OK))); 60 static assert(!is(typeof(Compileable!(bug5245b!(int)()).OK))); 61 static assert(!is(typeof(Compileable!(bug5245c!(int)()).OK))); 62 static assert(!is(typeof(Compileable!(bug5245d!(int)()).OK))); 63 64 /**************************************/ 65 Bug5349(T)66class Bug5349(T) // segfault D2.051 67 { 68 int x; 69 static int g() 70 { 71 class B 72 { 73 int inner() 74 { 75 return x; // should not compile 76 } 77 } 78 return (new B).inner(); 79 } 80 int y = g(); 81 } 82 83 static assert(!is(typeof(Bug5349!(int)))); 84 85 /**************************************/ 86 87 class Bug4033 {} 88 Template4033(T)89class Template4033(T) { 90 static assert(is(T : Bug4033)); 91 } 92 93 alias Template4033!(Z4033) Bla; 94 95 class Z4033 : Bug4033 { } 96 97 /**************************************/ 98 99 struct Bug4322 { 100 int[1] a = void; 101 } 102 bug4322()103void bug4322() { 104 Bug4322 f = Bug4322(); 105 Bug4322 g = Bug4322.init; 106 } 107