This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] RenamerClangTidy wont emit fixes in scratch space
ClosedPublic

Authored by njames93 on Jun 19 2020, 2:07 AM.

Details

Summary

Prevent fixes being displayed if usages are found in the scratch buffer.
See Fix-It hints are being generated in the ScratchBuffer.
It may be wise down the line to put in a general fix in clang-tidy to prevent ScratchBuffer replacements being applied, but for now this will help.

Diff Detail

Event Timeline

njames93 created this revision.Jun 19 2020, 2:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2020, 2:07 AM
aaron.ballman added inline comments.Jun 21 2020, 9:34 AM
clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp
570

I may be misunderstanding the comment here. I can understand not wanting to generate fixits into the scratch buffer (that would not do good things), but I think we still want a warning were it not for the macro, right? Just verifying that this is not changing warning behaviors, only fix-it behaviors.

njames93 marked an inline comment as done.Jun 21 2020, 10:57 AM
njames93 added inline comments.
clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp
570

You're absolutely right, however right now this fix just marks it as being InsideMacro. The reason diagnostics aren't emitted is becuase somewhere in this checks life someone decided to not emit warnings for declarations with usages inside macros. If that behaviour is to be changed a separate patch would be required.

This revision is now accepted and ready to land.Jun 22 2020, 7:42 AM
This revision was automatically updated to reflect the committed changes.