aaron.ballman requested changes to this revision.
aaron.ballman added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp:28
+/// Replace invalid characters in the identifier with '_'.
+static std::string replaceInvalidChars(StringRef Identifier) {
+  std::string Fixed{Identifier};
----------------
This fixes some issues but I think it introduces new issues too. The old code 
would accept Unicode characters and pass them along as (valid) identifier 
characters. The new code will replace all the Unicode characters with `_` which 
means some people's header guards may go from useful to `_______________`. We 
should definitely add test cases for Unicode file names.

Ultimately, I think this functionality will want to use `UnicodeCharSets.h` to 
implement something along the lines of what's done in 
`isAllowedInitiallyIDChar()` and `isAllowedIDChar()` from Lexer.cpp.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114149

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to