[PATCH] D133887: [Clang] Support label at end of compound statement

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 12:04:27 PDT 2022


aaron.ballman added a comment.

In D133887#3790414 <https://reviews.llvm.org/D133887#3790414>, @cor3ntin wrote:

> Thanks for doing that work.
>
> Given that this paper was touted as a C compatibility feature, I think we should implement the C feature at the same time
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf
>
> If my understanding is correct the change implemented here should just be allowed - without warning in C23
> What do you think @aaron.ballman ?

I don't think the two papers diverge in any way, so I think the implementation for one should basically cover the work for the other (aside from test cases, etc). It should definitely be without warning in C23 mode and give an extension warning in earlier modes.

In D133887#3791243 <https://reviews.llvm.org/D133887#3791243>, @shafik wrote:

> The proposal says:
>
>> A label at the end of a compound statement is treated as if it were followed by a null statement
>
> Does it make sense to write an AST test to verify this?

I think a test like that would be reasonable, yes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133887/new/

https://reviews.llvm.org/D133887



More information about the cfe-commits mailing list