summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/pr36069.C
blob: efb35c25716ad21ece8d4597eda5b5dcad5bc6ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}