diff options
author | Marek Polacek <polacek@redhat.com> | 2020-04-19 12:12:01 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2020-04-20 15:35:06 -0400 |
commit | 5bdd4c5d3fc9c143e8edea3b10828e4b75d7a385 (patch) | |
tree | a420b94a2c82e22905063b7d211a6de100a4f424 /libphobos/libdruntime/gcc | |
parent | c5e4be6b3645fb2294296310a3705f8be0e75da8 (diff) | |
download | gcc-5bdd4c5d3fc9c143e8edea3b10828e4b75d7a385.zip gcc-5bdd4c5d3fc9c143e8edea3b10828e4b75d7a385.tar.gz gcc-5bdd4c5d3fc9c143e8edea3b10828e4b75d7a385.tar.bz2 |
c++: Fix bogus -Wparentheses warning with fold-expression [PR94505]
We issue bogus -Wparentheses warnings (3 of them!) for this fold expression:
((B && true) || ...)
Firstly, issuing a warning for a compiler-generated expression is wrong
and secondly, B && true must be wrapped in ( ) otherwise you'll get
error: binary expression in operand of fold-expression.
PR c++/94505 - bogus -Wparentheses warning with fold-expression.
* pt.c (fold_expression): Add warning_sentinel for -Wparentheses
before calling build_x_binary_op.
* g++.dg/cpp1z/fold11.C: New test.
Diffstat (limited to 'libphobos/libdruntime/gcc')
0 files changed, 0 insertions, 0 deletions