[PATCH] D73090: [clang-tidy] Fix PR#44528 'modernize-use-using and enums'

Karasev Nikita via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 2 22:17:17 PST 2020


f00kat added a comment.

Sorry for my english. Sometimes it's more difficult than bug fixing



================
Comment at: clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp:74
   if (ReplaceRange.getBegin().isMacroID() ||
-      ReplaceRange.getBegin() >= LastReplacementEnd) {
+      (Result.SourceManager->getFileID(ReplaceRange.getBegin()) != Result.SourceManager->getFileID(LastReplacementEnd)) ||
+      (ReplaceRange.getBegin() >= LastReplacementEnd)) {
----------------
aaron.ballman wrote:
> Be sure to run clang-format over the patch; this looks well beyond the usual 80-col limit. You can also drop the unnecessary parens around the sub expressions.
> 
> Also, a comment explaining why this code is needed would help future folks as would a test case showing what this corrects.
I left the brackets because they seem to increase readability. Or not? :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73090





More information about the cfe-commits mailing list