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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 4 07:14:21 PDT 2016


aaron.ballman added a comment.

For cases where the external linkage is desired, how would you go about silencing this diagnostic?


================
Comment at: test/clang-tidy/google-global-names.cpp:13-14
@@ +12,4 @@
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: 'i' declared in the global namespace
+extern int ii = 0;
+// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: 'ii' declared in the global namespace
+
----------------
This strikes me as being intentional enough to warrant not diagnosing because of the `extern` keyword.


https://reviews.llvm.org/D23130





More information about the cfe-commits mailing list