[PATCH] D52187: [clang-tidy] use CHECK-NOTES in bugprone-unused-return-value

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 18 02:23:30 PDT 2018


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG with a comment.



================
Comment at: test/clang-tidy/bugprone-unused-return-value.cpp:81
   std::async(std::launch::async, increment, 42);
-  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: the value returned by this function should be used [bugprone-unused-return-value]
+  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value returned by this function should be used [bugprone-unused-return-value]
+  // CHECK-NOTES: [[@LINE-2]]:3: note: cast the expression to void to silence this warning
----------------
I'd probably cut repeated parts of the pattern (starting from the second one) to make them fit 80 characters, e.g. like this:
  // CHECK-NOTES: [[@LINE-1]]:3: warning: the value {{.*}} should be used

Same for the notes.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52187





More information about the cfe-commits mailing list