Bug 10420 – Incorrect function attributes in `core.exception`

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-20T01:11:00Z
Last change time
2014-11-13T00:45:16Z
Keywords
pull
Assigned to
verylonglogin.reg
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2013-06-20T01:11:19Z
--- import core.exception; void f1(int i) nothrow // OK { assert(i); } void f2(int i) nothrow // OK { if(!i) throw new AssertError(__FILE__, __LINE__); } void f3(int i) nothrow // error, should be OK { if(!i) onAssertError(); } void main() { // accepted, should be rejected: setAssertHandler((file, line, msg) { throw new Exception(""); }); f1(0); // nothrow function will throw an `Exception` } ---
Comment #1 by verylonglogin.reg — 2013-06-20T01:14:24Z
Comment #2 by github-bugzilla — 2013-06-21T02:54:40Z
Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/bc849e38ff1e6e6341c0e2b0250a1659dae929a3 Fix Issue 10420. Mark `core.exception` functions with `pure`, `nothrow`, and friends. Require user-supplied assert hander to be `nothrow`. Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=10420 https://github.com/D-Programming-Language/druntime/commit/f4a823756f7e5e1069ea2117b64fffa9cd75c149 Merge pull request #527 from denis-sh/add-`core.exception`-functions-attributes Fix Issue 10420 - Incorrect function attributes in `core.exception`
Comment #3 by dlang-bugzilla — 2014-11-13T00:45:16Z
Why are these functions even public at all?