Page MenuHomePhabricator

[clang-tidy] Add 'included from' details to warning message.
Needs RevisionPublic

Authored by sbenza on Jun 28 2016, 1:22 PM.

Details

Reviewers
alexfh
Summary

Add 'included from' details to warning message to google-global-names-in-headers.
It should make it clearer on those cases where a non-header is being mistakenly #included.

Diff Detail

Event Timeline

sbenza updated this revision to Diff 62133.Jun 28 2016, 1:22 PM
sbenza retitled this revision from to [clang-tidy] Add 'included from' details to warning message..
sbenza updated this object.
sbenza added a reviewer: alexfh.
sbenza added a subscriber: cfe-commits.
alexfh added inline comments.Jul 4 2016, 3:36 AM
clang-tidy/google/GlobalNamesInHeadersCheck.cpp
49

Static functions are preferred in LLVM. http://llvm.org/docs/CodingStandards.html#anonymous-namespaces

"make anonymous namespaces as small as possible, and only use them for class declarations. "

96

It's more common to present this kind of additional information as notes. As a bonus, the location of the note can point to the #include directive, which will make the whole diagnostic more useful.

Also, we might want to figure out why clang-tidy doesn't print "in file included from ..." itself, as clang does (but until then we can have this hand-rolled implementation).

alexfh requested changes to this revision.Jul 4 2016, 3:36 AM
alexfh edited edge metadata.
This revision now requires changes to proceed.Jul 4 2016, 3:36 AM

Ping ;)
Do you have time to finish this?