[PATCH] D154290: [Clang] Implement P2741R3 - user-generated static_assert messages

Sergei Barannikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 8 11:40:59 PDT 2023


barannikov88 added a comment.

According to the current wording, the static_assert-message is either unevaluated string or an expression evaluated at compile time.
Unevaluated strings don't allow certain escape sequences, but if I wrap the string in a string_view-like class, I'm allowed to use any escape sequeces, including '\x'.
Moreover, wrapping a string in a class would change its encoding. Unevaluated strings are displayed as written in the source (that is, UTF-8), while wrapped strings undergo conversion to execution encoding (e.g. EBCDIC) and then printed in system locale, leading to mojibake.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154290



More information about the cfe-commits mailing list