owenpan added a comment.

In D134853#3829433 <https://reviews.llvm.org/D134853#3829433>, @rymiel wrote:

> So, after some investigation, it turns out the clang lexer only combines an 
> underscore-less UDL to a single `string_literal` token if it's a valid 
> standard library UDL (in the given standard library version)

And only if there are no spaces between `""` and the identifier. Otherwise, 
it's invalid. See https://en.cppreference.com/w/cpp/language/user_literal.

> Which means only single-token `string_literal`s should be considered

We don't want to merge e.g. `"" _foo` or `"" if` into a single token `""_foo` 
or `""if`. With the former, the user may want clang-format to keep the space. 
With the latter, I'm not sure if it's ok for clang-format to fix the syntax 
error.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134853

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to