Bug 10520 – [profile+nothrow] Building with profiler results in "is not nothrow" error on some contracts

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-01T01:49:00Z
Last change time
2014-06-29T07:09:44Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg
Depends on
12979

Comments

Comment #0 by verylonglogin.reg — 2013-07-01T01:49:17Z
Some in/out contracts causes "is not nothrow" error when building with "-profile". The only compiler output e.g. for: --- ... void copyFrom(R)(R r) if(isInputRange!R && is(ElementType!R == T)) out { assert(func(_buff)); } body { _buff = r.array(); } ... --- is: --- ..\utils.d(nnn): Error: 'utils.Type!X.Type.func' is not nothrow --- Workaround: Disable these contracts or move its code to function body.
Comment #1 by kekeniro2 — 2013-08-27T20:26:17Z
*** This issue has been marked as a duplicate of issue 10617 ***
Comment #2 by verylonglogin.reg — 2013-10-30T07:22:07Z
This is not a duplicate. Even error message is different. Reduced testcase: --- void f() { } void g(T)() in { f(); } // Error: 'main.f' is not nothrow body { } alias gi = g!int; ---
Comment #3 by jiki — 2014-05-17T07:26:50Z
Comment #4 by github-bugzilla — 2014-06-29T06:58:58Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a219f511c875d322e8ccb47e3b273237b99d437e Fix: Issue 10520 - [profile+nothrow] Building with profiler results in "is not nothrow" error on some contracts When Statement#blockExit() checks if the statements may throw or not, it can also emit compile error. We turn the second argument of it, mustNotThrow, to false so that the error is suppressed. https://github.com/D-Programming-Language/dmd/commit/e6c308938d02d1cbfc57c37c03d06bff0ec00c74 Merge pull request #3554 from qchikara/FIX_profile_contract_nothrow Fix: Issue 10520 - [profile+nothrow] Building with profiler results in "...
Comment #5 by k.hara.pg — 2014-06-29T07:09:44Z
The merged PR is not fundamental fix, so mark as "worksforme".