[PATCH] D60776: [clang-tidy] Add test support for the fix description.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 24 06:21:25 PDT 2019


hokein updated this revision to Diff 201221.
hokein added a comment.

Use CHECK-NOTES.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60776/new/

https://reviews.llvm.org/D60776

Files:
  clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp


Index: clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp
+++ clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp
@@ -78,13 +78,15 @@
 // ----- Using declarations -----
 // eol-comments aren't removed (yet)
 using n::A; // A
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: using decl 'A' is unused
+// CHECK-NOTES: :[[@LINE-1]]:10: warning: using decl 'A' is unused
+// CHECK-NOTES: [[@LINE-2]]:10: note: remove the using
 // CHECK-FIXES: {{^}}// A
 using n::B;
 using n::C;
 using n::D;
 using n::E; // E
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: using decl 'E' is unused
+// CHECK-NOTES: :[[@LINE-1]]:10: warning: using decl 'E' is unused
+// CHECK-NOTES: [[@LINE-2]]:10: note: remove the using
 // CHECK-FIXES: {{^}}// E
 using n::F;
 using n::G;
@@ -99,10 +101,12 @@
 using n::UsedFunc;
 using n::UsedTemplateFunc;
 using n::UnusedInstance; // UnusedInstance
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: using decl 'UnusedInstance' is unused
+// CHECK-NOTES: :[[@LINE-1]]:10: warning: using decl 'UnusedInstance' is unused
+// CHECK-NOTES: [[@LINE-2]]:10: note: remove the using
 // CHECK-FIXES: {{^}}// UnusedInstance
 using n::UnusedFunc; // UnusedFunc
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: using decl 'UnusedFunc' is unused
+// CHECK-NOTES: :[[@LINE-1]]:10: warning: using decl 'UnusedFunc' is unused
+// CHECK-NOTES: [[@LINE-2]]:10: note: remove the using
 // CHECK-FIXES: {{^}}// UnusedFunc
 using n::cout;
 using n::endl;
@@ -115,7 +119,8 @@
 }
 
 using n::OverloadFunc; // OverloadFunc
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: using decl 'OverloadFunc' is unused
+// CHECK-NOTES: :[[@LINE-1]]:10: warning: using decl 'OverloadFunc' is unused
+// CHECK-NOTES: [[@LINE-2]]:10: note: remove the using
 // CHECK-FIXES: {{^}}// OverloadFunc
 
 #define DEFINE_INT(name)        \
@@ -150,9 +155,11 @@
 }
 
 using n::Color1;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: using decl 'Color1' is unused
+// CHECK-NOTES: :[[@LINE-1]]:10: warning: using decl 'Color1' is unused
+// CHECK-NOTES: [[@LINE-2]]:10: note: remove the using
 using n::Green;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: using decl 'Green' is unused
+// CHECK-NOTES: :[[@LINE-1]]:10: warning: using decl 'Green' is unused
+// CHECK-NOTES: [[@LINE-2]]:10: note: remove the using
 using n::Color2;
 using n::Color3;
 using n::Blue;
@@ -166,8 +173,8 @@
 
 // FIXME: Currently non-type template arguments are not supported.
 using n::Constant;
-// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: using decl 'Constant' is unused
-
+// CHECK-NOTES: :[[@LINE-1]]:10: warning: using decl 'Constant' is unused
+// CHECK-NOTES: [[@LINE-2]]:10: note: remove the using
 // ----- Usages -----
 void f(B b);
 void g() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60776.201221.patch
Type: text/x-patch
Size: 2846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190524/11cb5979/attachment.bin>


More information about the cfe-commits mailing list