[Issue 21225] preview=dtorfields inserts unnecessary dtor call in nothrow ctors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 4 23:50:07 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=21225

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #1 from Dlang Bot <dlang-bot at dlang.rocks> ---
@MoonlightSentinel created dlang/dmd pull request #11692 "Fix 21225 -
preview=dtorfields inserts unnecessary dtor calls..." fixing this issue:

- Fix 21225 - preview=dtorfields inserts unnecessary dtor calls...

  ... in nothrow ctors

  Fixed by not inserting the destructor call if the constructor is
  `nothrow` - which makes the generated `catch`-block unreachable
  (unless the ctor violates it's `nothrow` guarantee - which is UB).

  This also saves time & memory spent on generating unused AST elements.

https://github.com/dlang/dmd/pull/11692

--


More information about the Digitalmars-d-bugs mailing list