summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/clean-up-code.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2016-10-17 17:25:02 +0000
committerAlexander Kornienko <alexfh@google.com>2016-10-17 17:25:02 +0000
commit98d3391a59992b6cfedd4e620c910071622075bf (patch)
tree5b5f88dba953fd9dfa9893650245c3a0e026c84c /clang-tools-extra/test/clang-tidy/clean-up-code.cpp
parent083f1626f540954f712cca55fc6e3371f890e80e (diff)
downloadbcm5719-llvm-98d3391a59992b6cfedd4e620c910071622075bf.tar.gz
bcm5719-llvm-98d3391a59992b6cfedd4e620c910071622075bf.zip
[clang-tidy] Clean up code after applying replacements.
Summary: Remove empty namespaces and initializer list commas / colons in affected ranges. Initial patch: proper options for enabling the cleanup and specifying the format style are needed. Reviewers: hokein, ioeric Subscribers: beanz, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D24572 llvm-svn: 284399
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