Following code, consumes 100% for an infinite period of time. However, if I use benchmark with predefined function - everything is OK. The code to reproduce: import std.date; void main() { ulong[] measures = benchmark!(delegate void() { for(int i = 0; i < 100_000; i++) { auto res1 = cmp1 == cmp2; } })(1, null); }
Thank you for going through the trouble of creating an account and reporting this.
This is not a Phobos issue, it's a bug in DMD. I've reported it with a reduced test case, see issue 4359.