[PATCH] D41655: [clang-tidy] New check bugprone-unused-return-value

Kalle Huttunen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 7 10:12:25 PST 2018


khuttun marked 2 inline comments as done.
khuttun added inline comments.


================
Comment at: test/clang-tidy/bugprone-unused-return-value.cpp:163
+
+void noWarning() {
+  auto AsyncRetval1 = std::async(increment, 42);
----------------
aaron.ballman wrote:
> Sorry, I just realized that we're missing a test case for a common situation -- where the result is used as part of another call expression. Can you add a test to `noWarning()` to make sure this does not warn:
> ```
> std::vector<int> v;
> extern void f(bool);
> 
> f(v.empty()); // Should not warn
> ```
See line 199 in this file.


https://reviews.llvm.org/D41655





More information about the cfe-commits mailing list