[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

Zinovy Nis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 1 10:32:27 PDT 2018


zinovy.nis added inline comments.


================
Comment at: clang-tidy/modernize/RawStringLiteralCheck.cpp:111
+  // Upper ASCII are disallowed too.
+  for (unsigned char C = 0xFFu; C >= 0x80u; --C)
+    DisallowedChars.set(C);
----------------
LegalizeAdulthood wrote:
> Why does this loop go down instead of up?  I would have expected a more conventional
> 
> for (unsigned char C = 0x80u; C <= 0xFFu; ++C)
The only reason is that `++C` for `C==0xFFu` is `0` so `C <= 0xFF` is always satisfied leading to inifinite loop.


https://reviews.llvm.org/D45932





More information about the cfe-commits mailing list