summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/pr36069.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/pr36069.C')
-rw-r--r--gcc/testsuite/g++.dg/warn/pr36069.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/pr36069.C b/gcc/testsuite/g++.dg/warn/pr36069.C
new file mode 100644
index 000000000..efb35c257
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr36069.C
@@ -0,0 +1,16 @@
+// PR c++/36069 Strange "warning: suggest parentheses around
+// assignment used as truth value" with volatile/non volatile bools
+// { dg-do compile }
+// { dg-options "-Wparentheses" }
+struct foo {
+ bool a;
+ volatile bool b,c;
+ foo() { a = b = c = false; } // { dg-bogus "parentheses" }
+};
+
+int main() {
+ bool a;
+ volatile bool b,c;
+ a = b = c = false; // { dg-bogus "parentheses" }
+ foo A;
+}