gcc/testsuite/g++.dg/cpp1z/fold11.C
raw| 1 | // PR c++/94505 - bogus -Wparentheses warning with fold-expression. |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | // { dg-options "-Wparentheses" } |
| 4 | |
| 5 | template <bool... B> |
| 6 | bool foo () { |
| 7 | return ((B && true) || ...); // { dg-bogus "suggest parentheses" } |
| 8 | } |
| 9 | |
| 10 | int main () { |
| 11 | foo<true, false, false, true> (); |
| 12 | } |