This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] No misc-definitions-in-headers warning on C++14 variable templates.
ClosedPublic

Authored by hokein on Feb 12 2020, 12:53 AM.

Diff Detail

Event Timeline

hokein created this revision.Feb 12 2020, 12:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2020, 12:53 AM
Herald added a subscriber: xazax.hun. · View Herald Transcript
gribozavr2 accepted this revision.Feb 12 2020, 4:05 AM
gribozavr2 added inline comments.
clang-tools-extra/docs/clang-tidy/checks/misc-definitions-in-headers.rst
86

s/is allowed/are inline/

clang-tools-extra/test/clang-tidy/checkers/misc-definitions-in-headers-1z.hpp
14

I would prefer if you could make the test compatible with all language modes after C++11. You can do it by wrapping the variable template in #ifs on the __cplusplus macro that contains the language version.

This revision is now accepted and ready to land.Feb 12 2020, 4:05 AM
hokein updated this revision to Diff 244184.Feb 12 2020, 7:47 AM
hokein marked 2 inline comments as done.

Address review comments.

clang-tools-extra/test/clang-tidy/checkers/misc-definitions-in-headers-1z.hpp
14

I'd prefer keep it as it-is. using __cplusplus seems a bit hacky to me, and I think it only works for non-CHECK-MESSAGES cases.

This revision was automatically updated to reflect the committed changes.