Skip to content

Commit

Permalink
Trivial fix for broken algorithm.d unittest
Browse files Browse the repository at this point in the history
In the existing compiler, using 'new int' inside a struct static initializer
is silently ignored.
  • Loading branch information
Don Clugston committed Apr 14, 2011
1 parent 325a8fe commit ca64cc2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion std/algorithm.d
Expand Up @@ -1359,7 +1359,8 @@ unittest
assert(s11.a == 10 && s11.b == 11 && s12.a == 10 && s12.b == 11);

struct S2 { int a = 1; int * b; }
S2 s21 = { 10, new int };
S2 s21 = { 10, null };
s21.b = new int;
S2 s22;
move(s21, s22);
assert(s21 == s22);
Expand Down

0 comments on commit ca64cc2

Please sign in to comment.