[PATCH] D129048: Rewording the "static_assert" to static assertion

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 5 04:40:10 PDT 2022


aaron.ballman added a comment.

Thank you for getting a great start on this diagnostic rewording!

I think we should also update DiagnosticParseKinds.td at the same time, but because that's about parsing rather than semantics, not all of the diagnostics should be reworded to use "static assertion".

`err_expected_semi_after_static_assert` should switch to use `%0` and pass in the actual parsed token -- I am pretty sure (but not 100% sure because I didn't try this myself) that it will print the actual spelling used for the token in that case.

`warn_cxx98_compat_static_assert` should get single quotes around the `static_assert` in the message, but is otherwise fine.

`ext_ms_static_assert`, `ext_cxx_static_assert_no_message`, `ext_c_static_assert_no_message`, `warn_cxx14_compat_static_assert_no_message`, `warn_c17_compat_static_assert_no_message`, and `err_templated_invalid_declaration` are all fine as-is.



================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:11133
 def ext_export_no_name_block : ExtWarn<
-  "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration "
+  "ISO C++20 does not permit %select{an empty|a static assertion}0 declaration "
   "to appear in an export block">, InGroup<ExportUnnamed>;
----------------
This is a case where the original text was slightly better -- this diagnostic is only issued for C++ code (modules don't exist in C), so using `static_assert` was fine.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:11142
 def err_export_no_name : Error<
-  "%select{empty|static_assert|asm}0 declaration cannot be exported">;
+  "%select{empty|static assertion|asm}0 declaration cannot be exported">;
 def ext_export_using_directive : ExtWarn<
----------------
Same is true here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129048



More information about the cfe-commits mailing list