[PATCH] D108742: [WIP] Reclassify form-feed and vertical tab as vertical WS for the purposes of lexing.

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 27 16:02:58 PDT 2021


hubert.reinterpretcast added a comment.

I find the lack of changes to tests other than API unittests to be somewhat concerning.
Indeed, I applied the patch and did not notice behaviour changes in how `\f` or `\v` were handled in various contexts sensitive to line-termination.

For example:

  clang -fsyntax-only -xc -<<<$'#define X\f int\n#define Y\v x;\ncha\\\v\nr x;\n// \fextern int x;\n'
  <stdin>:3:5: warning: backslash and newline separated by space [-Wbackslash-newline-escape]
  cha\<U+000B>
      ^
  1 warning generated.

It appears phase 3 whitespace conversion is applied to `\f` and `\v` and the macro definitions extend to the `\n`s.
The `\v\n` sequence is treated as only one newline (backslash escaped) and not two (with only the `\v` escaped).
It also appears that the `//` comment is not terminated by the `\f`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108742



More information about the cfe-commits mailing list