================
@@ -0,0 +1,45 @@
+// RUN: %clang_cc1 -x c++ -fsyntax-only -Wparentheses -verify %s
+
+// Do not emit the warning for compound-assignments.
+bool f(int x) { return x = 0; } // expected-warning {{suggest parentheses
around assignment used as truth value}} \
+ // expected-note{{place parentheses around
the assignment to silence this warning}}
+bool f2(int x) { return x += 0; }
+
+bool f3(bool x) { return x = 0; }
+
+void test() {
+ int x;
+
+ // Assignemnts inside of conditions should still emit the more specific
`warn_condition_is_assignment` warning.
----------------
erichkeane wrote:
```suggestion
// Assignments inside of conditions should still emit the more specific
`warn_condition_is_assignment` warning.
```
https://github.com/llvm/llvm-project/pull/115234
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits