The reason it doesn't work is scope(exit). Looking at the code[1], it doesn't look like the scope(exit) is really necessary here (I don't see why it should catch exceptions thrown by parse), so until there's scope(...) CTFE support, a simple fix would be to rewrite the code as: auto result = parse!T(v); if (v.length) convError!(SV, T)(v); return result; [1]: https://github.com/D-Programming-Language/phobos/blob/master/std/conv.d#L1606
Do you have a test case that doesn't work? scope statements are supported in CTFE now. This works on git DMD head: import std.conv; static assert(to!int("754") == 754);
Right, should have updated before reporting. Sorry for the noise.