C++ Logo


Advanced search

Re: [wg14/wg21 liaison] unreachable control flow

From: Miguel Ojeda <miguel.ojeda.sandonis_at_[hidden]>
Date: Tue, 18 May 2021 18:03:14 +0200
On Tue, May 18, 2021 at 6:00 PM Jā‚‘ā‚™ā‚› Gustedt <jens.gustedt_at_[hidden]> wrote:
> I think that the two are really not the same. Calling `abort()` has
> defined behavior, it forces the implementation to branch conditionally
> and to terminate the execution if the branch is taken. My idea of
> `unreachable` would be that the implementation may produce code they
> want, and in particular they may remove the test of the condintional
> and unreachable branch completely. It is the user's responsibility to
> make sure that this ok, it is the compiler's responsibility to make the
> best from that assumption.

Please note I said "assuming this is the aborting one" :-)


Received on 2021-05-18 11:03:26