summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/clean-up-code.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/clean-up-code.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/clean-up-code.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/clean-up-code.cpp b/clang-tools-extra/test/clang-tidy/clean-up-code.cpp
new file mode 100644
index 00000000000..96b3a45178b
--- /dev/null
+++ b/clang-tools-extra/test/clang-tidy/clean-up-code.cpp
@@ -0,0 +1,12 @@
+// RUN: %check_clang_tidy %s misc-unused-using-decls %t
+namespace a { class A {}; }
+namespace b {
+using a::A;
+}
+namespace c {}
+// CHECK-MESSAGES: :[[@LINE-3]]:10: warning: using decl 'A' is unused [misc-unused-using-decls]
+// CHECK-FIXES: {{^namespace a { class A {}; }$}}
+// CHECK-FIXES-NOT: namespace
+// CHECK-FIXES: {{^namespace c {}$}}
+// FIXME: cleanupAroundReplacements leaves whitespace. Otherwise we could just
+// check the next line.
OpenPOWER on IntegriCloud