[PATCH] D55410: [clang-tidy] check for flagging using declarations in headers
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 7 06:33:47 PST 2018
lebedev.ri added inline comments.
================
Comment at: clang-tidy/abseil/AliasFreeHeadersCheck.cpp:22
+ // Match all using declarations in header files.
+ Finder->addMatcher(usingDecl(isExpansionInFileMatching(".*\\.h.*")).bind("x"),
+ this);
----------------
Relevant:
```
$ clang-tidy -dump-config | grep -i extension -A1
- key: cert-dcl59-cpp.HeaderFileExtensions
value: ',h,hh,hpp,hxx'
--
- key: google-build-namespaces.HeaderFileExtensions
value: h,hh,hpp,hxx,
- key: google-global-names-in-headers.HeaderFileExtensions
value: h,hh,hpp,hxx,
--
- key: misc-definitions-in-headers.HeaderFileExtensions
value: h,hh,hpp,hxx,
- key: misc-definitions-in-headers.UseHeaderFileExtension
value: '1'
```
The list of header suffixes should be configurable.
================
Comment at: clang-tidy/abseil/AliasFreeHeadersCheck.cpp:29
+ diag(MatchedDecl->getLocation(), "convenience aliases in header files are "
+ "dangerous: see http://google.github.io/styleguide/cppguide.html#Aliases");
+}
----------------
http**s**
================
Comment at: clang-tidy/abseil/AliasFreeHeadersCheck.h:19
+
+/// FIXME: Write a short description.
+///
----------------
Hm
================
Comment at: docs/clang-tidy/checks/list.rst:155
hicpp-undelegated-constructor (redirects to bugprone-undelegated-constructor) <hicpp-undelegated-constructor>
+ hicpp-uppercase-literal-suffix (redirects to readability-uppercase-literal-suffix) <hicpp-uppercase-literal-suffix>
hicpp-use-auto (redirects to modernize-use-auto) <hicpp-use-auto>
----------------
Many unrelated movements.
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55410/new/
https://reviews.llvm.org/D55410
More information about the cfe-commits
mailing list