[PATCH] D53817: [clang-tidy] cppcoreguidelines-macro-usage: print macro names

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 29 07:20:00 PDT 2018


lebedev.ri created this revision.
lebedev.ri added reviewers: JonasToth, aaron.ballman, hokein, xazax.hun, alexfh.
lebedev.ri added a project: clang-tools-extra.
Herald added subscribers: rnkovacs, kbarton, nemanjai.

The macro may not have location (or more generally, the location may not exist),
e.g. if it originates from compiler's command-line.

The check complains on all the macros, even those without the location info.
Which means, it only says it does not like it. What is 'it'? I have no idea.
If we don't print the name, then there is no way to deal with that situation.

And in general, not printing name here forces the user to try to understand,
given, the macro definition location, what is the macro name?
This isn't fun.

I suspect some more issues may crop up later.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53817

Files:
  clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp
  clang-tidy/cppcoreguidelines/MacroUsageCheck.h
  test/clang-tidy/cppcoreguidelines-macro-usage-caps-only.cpp
  test/clang-tidy/cppcoreguidelines-macro-usage-custom.cpp
  test/clang-tidy/cppcoreguidelines-macro-usage.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53817.171495.patch
Type: text/x-patch
Size: 7737 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181029/12e22ef4/attachment-0001.bin>


More information about the cfe-commits mailing list