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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 04:55:50 PST 2020


aaron.ballman closed this revision.
aaron.ballman added a comment.

In D73090#1854031 <https://reviews.llvm.org/D73090#1854031>, @f00kat wrote:

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


It's not a problem at all, that's why we help one another out spotting those things! :-)

I've commit on your behalf in 6423ae417e17611c4ee529f5848e839e6d9cb795 <https://reviews.llvm.org/rG6423ae417e17611c4ee529f5848e839e6d9cb795>



================
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)) {
----------------
f00kat wrote:
> 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? :)
We don't typically use them unless there's a need, but it doesn't harm readability to keep them, so this is fine.


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