class A { pure static void raise(string s) { throw new Exception(s); } } void main() { A.raise("a"); } This code compiles and runs without an error!
// A pure function might have side effects, unless it is also nothrow. // PATCH: e2ir.c, line 288. e = el_una(op,tyret,ep); } else if (ep) { - e = el_bin(tf->ispure ? OPcallns : OPcall,tyret,ec,ep); + e = el_bin((tf->ispure && tf->isnothrow) ? OPcallns : OPcall,tyret,ec,ep); } else { - e = el_una(tf->ispure ? OPucallns : OPucall,tyret,ec); + e = el_una((tf->ispure && tf->isnothrow) ? OPucallns : OPucall,tyret,ec); } if (retmethod == RETstack)
Related SVN revision: http://www.dsource.org/projects/dmd/changeset/226
Fixed dmd 2.036