C++ Logo

std-proposals

Advanced search

Re: [std-proposals] alx-0088r0 - noreturn can't return

From: Alejandro Colomar <une+cxx_std-proposals_at_[hidden]>
Date: Sun, 15 Feb 2026 22:48:21 +0100
Hi Sebastian,

On 2026-02-15T21:49:43+0100, Sebastian Wittmeier via Std-Proposals wrote:
> 1)
>
> Having a comma at the end of a list also makes no sense.
>
> But it simplifies additions of additional entries/lines, automatic code generation, copy&paste, etc.
>
> a return statement could be created even for noreturn functions by
> macros, e.g. some macros create log messages for entering or leaving
> functions.

Could you please show a real case where a macro contains a return
statement and is used within a [[noreturn]] function?

Or if that's too difficult, could you please envision some code that
does it and makes some sense?

>
> 2)
>
> The return type is not part of the function signature for overloading,
> but it is part of the function type. Functions with different return
> types are not ABI compatible either.
>
> So a noreturn function could have a return type, but no return
> instruction?

Indeed; that's what they are. They are functions that have a return
type for compatibility reasons (e.g., callbacks), but which decide to
never return, for $reasons.


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es>

Received on 2026-02-15 21:48:41