Bug 17493 – nothrow constructor may throw

Status
RESOLVED
Resolution
INVALID
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-06-11T23:01:56Z
Last change time
2018-09-15T00:46:39Z
Assigned to
No Owner
Creator
Walter Bright
See also
https://issues.dlang.org/show_bug.cgi?id=17494

Comments

Comment #0 by bugzilla — 2017-06-11T23:01:56Z
struct S { ~this() {} } class C { S s; this() nothrow {} } produces: test.d(8): Error: destructor 'test.C.~this' is not nothrow test.d(8): Error: nothrow constructor 'test.C.this' may throw Introduced by: https://github.com/dlang/dmd/pull/6816
Comment #1 by bugzilla — 2017-06-12T00:16:13Z
Comment #2 by greensunny12 — 2017-06-12T20:20:28Z
Comment #3 by bugzilla — 2018-02-03T21:25:37Z
https://github.com/dlang/dmd/pull/6913 reverted 6816 which had caused the regression, so this bug is fixed.
Comment #4 by bugzilla — 2018-03-27T22:06:31Z
Why was this reopened?
Comment #5 by greensunny12 — 2018-03-27T22:17:59Z
(accidentally reopened - sorry)
Comment #6 by bugzilla — 2018-09-15T00:46:39Z
Changed this to INVALID. A constructor marked nothrow cannot have a field with a throwing destructor, because the destructor can get called if the constructor fails to complete.