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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 19 04:54:48 PDT 2022


aaron.ballman added a comment.

Thank you for working on this! I spotted an issue where we're not quite complete with this implementation work. I pushed up a new test case in https://github.com/llvm/llvm-project/commit/a244194f73788de6dfd6d753ff09be3625613f9f that shows it (and set the C status page back to Partial in case this takes a while to address), but `case` and `default` labels should be accepted the same as any other label at the end of a compound statement.

Btw, when working on C standards features, I've started adding test coverage that demonstrates we fully implement the paper into the `clang/test/C/` directory, under the correct standard version. This helps us to track the status of proposals a bit more easily within the code base.



================
Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:298-299
   "and have an empty entry in the selector">;
-def err_label_end_of_compound_statement : Error<
-  "label at end of compound statement: expected statement">;
+def err_switch_label_end_of_compound_statement : Error<
+  "label at end of switch compound statement: expected statement">;
+def ext_c_label_end_of_compound_statement : ExtWarn<
----------------
This is not an error in C2x or in C++2b.


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