view gcc/testsuite/g++.dg/warn/pr36069.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
line wrap: on
line source

// 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" }
  // { dg-warning "deprecated" "" { target c++2a } .-1 }
};

int main() {
  bool a;
  volatile bool b,c;
  a = b = c = false; // { dg-bogus "parentheses" }
  // { dg-warning "deprecated" "" { target c++2a } .-1 }
  foo A;
}