This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] IdentifierNamingCheck should only emit warnings when declaration or usage is outside of macros
AbandonedPublic

Authored by berenm on Sep 23 2015, 12:25 AM.

Details

Reviewers
alexfh
Summary

This fixes https://llvm.org/bugs/show_bug.cgi?id=24835.

The patch might be slightly different after http://reviews.llvm.org/D13079 and http://reviews.llvm.org/D13081, but the idea is the same.

Diff Detail

Event Timeline

berenm updated this revision to Diff 35467.Sep 23 2015, 12:25 AM
berenm retitled this revision from to [clang-tidy] IdentifierNamingCheck should only emit warnings when declaration or usage is outside of macros.
berenm updated this object.
berenm added a reviewer: alexfh.
berenm added a subscriber: cfe-commits.
berenm updated this revision to Diff 35468.Sep 23 2015, 12:40 AM

Even better with the corresponding unit test fix.

berenm updated this revision to Diff 35652.Sep 24 2015, 10:37 AM

Update the diff with more context, thanks to arcanist.

This will also disable all warnings for declaration / usages outside of the main file.

It might be better to disable the warnings and fixes whenever a macro is involved (in the declaration or any usage), but at least keep the warning across files, even if we don't offer fixes. I think the most common use-case will be to have some declaration in a header file and usages in multiple source files, and in this case warnings are interesting.

I'm assuming here that "main file" in clang tooling framework means the .cpp file from which the ast is built.

alexfh accepted this revision.Sep 26 2015, 4:51 PM
alexfh edited edge metadata.

Looks good. Should I submit this?

This revision is now accepted and ready to land.Sep 26 2015, 4:51 PM