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

Richard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 1 10:39:49 PDT 2018


LegalizeAdulthood 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);
----------------
zinovy.nis wrote:
> 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.
OK, makes sense.  I rarely write loops that iterate over character types.


https://reviews.llvm.org/D45932





More information about the cfe-commits mailing list