C++ Logo


Advanced search

Re: [wg14/wg21 liaison] P2961R1 syntax for Contracts: viable for C?

From: Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
Date: Fri, 6 Oct 2023 14:48:51 +0200

on Fri, 6 Oct 2023 09:40:09 +0300 you (Ville Voutilainen via Liaison
<liaison_at_[hidden]>) wrote:

> The <audit> part is at this point hypothetical. I'm curious why you
> think that's a bad choice.
> If I understand things correctly, it's novel for C to have function
> parameters be in scope
> after leaving a function declarator and before a function definition
> begins.

Not exactly. We fixed that for C23, such that indeed parameters may
remain visible for attributes in the gap between the parameter list and
the function body. The intent for that is then described in a footnote

      205) The visibility scope of a parameter in a function
      definition starts when its declaration is completed, extends to
      following parameter declarations, to possible attributes that
      follow the parameter type list, and then to the entire function
      body. The lifetime of each instance of a parameter starts when
      the declaration is evaluated starting a call and ends when that
      call terminates.


:: ICube :::::::::::::::::::::::::::::: deputy director ::
:: Université de Strasbourg :::::::::::::::::::::: ICPS ::
:: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus ::
:: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 ::
:: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Received on 2023-10-06 12:48:53