[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 6 15:36:23 PDT 2018


rsmith added inline comments.


================
Comment at: modernize/UseAutoCheck.cpp:40
+            ? Alpha
+            : (std::isspace(C) || (!RemoveStars && C == '*')) ? Space
+                                                              : Punctuation;
----------------
`isspace` here is wrong: it's a locale-sensitive check. Clang assumes UTF-8 throughout; you can use `isWhitespace` from clang/Basic/CharInfo.h to test if the character should be treated as whitespace.


https://reviews.llvm.org/D45927





More information about the cfe-commits mailing list