C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] unreachable control flow

From: Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
Date: Wed, 19 May 2021 10:51:39 +0200
Miguel,

on Wed, 19 May 2021 10:45:11 +0200 you (Miguel Ojeda
<miguel.ojeda.sandonis_at_[hidden]>) wrote:

> To clarify further, as a summary:
>
> Safe version (calls `abort()`, panics, etc.):
> - P0627: none.
> - Rust: `unreachable()`.
> - Zig: `unreachable` (on `Debug`, `ReleaseSafe` and tests).
>
> Unsafe version (introduces UB, allows to optimize):
> - P0627: `unreachable()`.
> - Rust: `unreachable_unchecked()`.
> - Zig: `unreachable` (on `ReleaseFast`).
>
> On Swift, the UB version can be approximated under `-Ounchecked` using
> `assert(false)`, e.g. https://godbolt.org/z/hsjKMWP55. So it is pretty
> similar to Zig's approach.

great, thanks, again !

Since nobody here seems to know where and if this is still going, I
will try to reach out to the author of P0627 to see if they still have
plans with this.

Jₑₙₛ

-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Received on 2021-05-19 03:51:45