From 98d3391a59992b6cfedd4e620c910071622075bf Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Mon, 17 Oct 2016 17:25:02 +0000 Subject: [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 --- clang-tools-extra/test/clang-tidy/clean-up-code.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 clang-tools-extra/test/clang-tidy/clean-up-code.cpp (limited to 'clang-tools-extra/test/clang-tidy/clean-up-code.cpp') 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. -- cgit v1.2.3