[clang-tools-extra] create new clang-tidy check to add namespaces to symbol references (PR #70621)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 30 08:02:17 PDT 2023


================
@@ -0,0 +1,22 @@
+// RUN: %check_clang_tidy %s readability-use-explicit-namespaces %t
+
+namespace foo
+{
+void doSomething()
+{
+}
+}
+
+void test1()
+{
+        foo::doSomething();
+}
+
+using namespace foo;
+
+void test2()
+{
+	// CHECK-MESSAGES: :[[@LINE+1]]:2: warning: Missing namespace qualifiers foo::
+        doSomething();
+}
+
----------------
EugeneZelenko wrote:

Excessive newline.

https://github.com/llvm/llvm-project/pull/70621


More information about the cfe-commits mailing list