C++ Logo

liaison

Advanced search

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

From: Timur Doumler <cpp_at_[hidden]>
Date: Fri, 6 Oct 2023 19:27:16 +0300
> On 6 Oct 2023, at 19:24, Jens Maurer <jens.maurer_at_[hidden]> wrote:
>
> On 06/10/2023 18.11, Aaron Ballman via Liaison wrote:
>> On Fri, Oct 6, 2023 at 9:58 AM Timur Doumler <cpp_at_[hidden]> wrote:
>> It's a footnote, so we're a bit imprecise with the wording of it. But
>> the intent here is "parse" means "lex and eat tokens until the closing
>> ]], paying attention to balance (, [, and { with ), ], and }". It's
>> "parsing" because of the balanced tokens and needing to find the
>> closing ]]. But the goal is for it to be a valid implementation to see
>> [[, eat balanced tokens until the closing ]], and drop everything on
>> the floor.
>
> That's not what the normative text says, though.
>
> C23 6.7.12p2 still says you need to parse the basic
> structure of attributes. For example, a ":" appearing
> as an attribute-token is required to be diagnosed as
> ill-formed.

If that is indeed the case, then the attribute-like syntax for Contracts would not be ignorable in C, either.

Martin, since you are the only one on this thread so far who advocated for the attribute-like syntax, I'm curious whether this would change your opinion at all?

Cheers,
Timur

Received on 2023-10-06 16:27:18