Page MenuHomePhabricator

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

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



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

Static functions are preferred in LLVM.

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


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?