[Issue 21951] Segfault on `noreturn.init`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 27 12:25:24 UTC 2021


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/dmd pull request #12768 "Merge stable into master" was merged into
master:

- 90bb0328af61ed7c3c4a0fa005578d9903a07991 by MoonlightSentinel:
  Fix 21951 - Add missing defaultInit literal for `noreturn`

  Otherwise further semantic for `noreturn` variables / overload resultion
  will segfault.

  The default initializer is defined as `assert(false)` for now. This
  might need to be revised to satisfy [1] once the backend is adapted to
  handle `noreturn` outside of return values (currently either crashes or
  hits assertion failures).

  [1]:
  > Defining a noreturn variable with no initialization expression
  > generates an assert(0) only if the variable is accessed, which can be
  > useful in generic code where unused noreturn variables may be declared

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

--


More information about the Digitalmars-d-bugs mailing list