Bug 11375 – [profile+nothrow] Semantic 'no throw' error with -profile switch

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-29T01:32:00Z
Last change time
2013-11-16T03:30:19Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
paolo.invernizzi

Comments

Comment #0 by paolo.invernizzi — 2013-10-29T01:32:13Z
This is compiled correctly without the '-profile' switch, it will fails otherwise (DMD 2.063.2, 2.064.beta.4): module b; class B { this() {} } module a; import b; class C : B {} class D(X) : X {} alias D!(C) Z; dmd -profile a.d Error: 'a.C.this' is not no throw
Comment #1 by yebblies — 2013-11-14T07:27:43Z
class B { this() {} } class D() : B {} void main() nothrow { auto d = new D!()(); } The check for throwing is run _before_ adding the implicit super call, so D.__ctor is inferred as nothrow. With -profile, the blockExit is run again to determine if a try-finally is necessary, and it errors on the super call. https://github.com/D-Programming-Language/dmd/pull/2765
Comment #2 by github-bugzilla — 2013-11-16T03:27:25Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f633cf3796920ff7c3062cc0218e2b2654f8630c Fix Issue 11375 - [profile+nothrow] Semantic 'no throw' error with -profile switch https://github.com/D-Programming-Language/dmd/commit/c5147ac15bc5cca6dbfd53f33505b7f1d06e4098 Merge pull request #2765 from yebblies/issue11375 Issue 11375 - [profile+nothrow] Semantic 'no throw' error with -profile switch