aaron.ballman added a comment.

I'm surprised this change didn't cause any other tests to need to be updated. A 
few small formatting nits and a request for another test, but otherwise looking 
good.



================
Comment at: test/SemaCXX/warn-unused-result.cpp:166
+// C++ Methods should warn even in their own class.
+struct[[clang::warn_unused_result]] S {
+  S DoThing() { return {}; };
----------------
Add a space between `struct` and the attribute introducer.


================
Comment at: test/SemaCXX/warn-unused-result.cpp:175
+
+struct[[clang::warn_unused_result]] P {
+  P DoThing() { return {}; };
----------------
Same here.


================
Comment at: test/SemaCXX/warn-unused-result.cpp:200
+  --p; // expected-warning {{ignoring return value}}
+}
+} // namespace
----------------
Can you add some tests showing that casting to void still silence the 
diagnostic even for these operator cases? It doesn't need to happen for all of 
them, but it's good to ensure that still behaves as expected.


https://reviews.llvm.org/D32207



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to