[PATCH] D23130: [Clang-tidy] Add a check for definitions in the global namespace.

Benjamin Kramer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 7 04:56:13 PST 2016


bkramer added inline comments.


================
Comment at: clang-tidy/google/GlobalNamesCheck.cpp:90
+    // extern "C" globals need to be in the global namespace.
+    if (VDecl->isExternC())
+      return;
----------------
alexfh wrote:
> Is this already filtered-out by the matcher?
Nope.


================
Comment at: clang-tidy/google/GoogleTidyModule.cpp:68
+    CheckFactories.registerCheck<readability::GlobalNamesCheck>(
+        "google-global-names");
     CheckFactories.registerCheck<clang::tidy::readability::FunctionSizeCheck>(
----------------
aaron.ballman wrote:
> Given that this was shipped under the old name, I think we need to figure out our policy for how to handle this. It also comes up in D26511, so I would like us to be consistent with what we do.
There was no special handling in D26511, so I left this as-is.


https://reviews.llvm.org/D23130





More information about the cfe-commits mailing list