It's useless and not safe to replace UTF-8 encoded with escaped ASCII to raw UTF-8 chars:
"\xE2\x98\x83" ---> "☃" (snowman)
Especially there's an explicit test for ASCII in this check.
Differential D45932
[clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals zinovy.nis on Apr 22 2018, 1:36 PM. Authored by
Details It's useless and not safe to replace UTF-8 encoded with escaped ASCII to raw UTF-8 chars: "\xE2\x98\x83" ---> "☃" (snowman) Especially there's an explicit test for ASCII in this check.
Diff Detail Event Timeline
Comment Actions
Comment Actions Other than a few minor nits, ship it.
Comment Actions Fixed in git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@331297 91177308-0d34-0410-b5e6-96231b3b80d8
|
I am starting to think that this functionality should be refactored because the check is now O(N^2) in the worst case because all of the bytes of the string need to be touched twice. It would be nice for performance reasons to combine this so that there's only a single pass over all of the characters.
What do you think?