[PATCH] D55410: [clang-tidy] check for flagging using declarations in headers

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 10 05:11:25 PST 2018


aaron.ballman added a comment.

Have you run this check over any large code bases to see what its false positive rate looks like? I have to imagine we're going to need some escape hatch for system headers (we shouldn't complain about using declarations outside of the user's control).



================
Comment at: clang-tidy/abseil/AliasFreeHeadersCheck.cpp:28
+  const auto *MatchedDecl = Result.Nodes.getNodeAs<UsingDecl>("x");
+  diag(MatchedDecl->getLocation(), "convenience aliases in header files are "
+    "dangerous: see http://google.github.io/styleguide/cppguide.html#Aliases");
----------------
What is a "convenience alias" and why is it dangerous? The diagnostic should explain what's wrong with the user's code.


================
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");
+}
----------------
lebedev.ri wrote:
> http**s**
No links in diagnostics, whether http or https. ;-)

Also, why should this be a separate check from the other positional one in D55411?


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