| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-Wparentheses" } |
| 3 |
|
| 4 |
// Template version of Wparentheses-2.C. |
| 5 |
|
| 6 |
int foo (int); |
| 7 |
|
| 8 |
int a, b, c; |
| 9 |
bool d; |
| 10 |
|
| 11 |
template<class T> |
| 12 |
void |
| 13 |
bar (T) |
| 14 |
{ |
| 15 |
if (a += b) |
| 16 |
foo (0); |
| 17 |
if (a -= a) |
| 18 |
foo (1); |
| 19 |
if (b *= c) |
| 20 |
foo (2); |
| 21 |
else |
| 22 |
foo (3); |
| 23 |
if (b /= b) |
| 24 |
foo (4); |
| 25 |
else |
| 26 |
foo (5); |
| 27 |
while (c %= b) |
| 28 |
foo (6); |
| 29 |
while (c <<= c) |
| 30 |
foo (7); |
| 31 |
do foo (8); while (a >>= b); |
| 32 |
do foo (9); while (a &= a); |
| 33 |
for (;c ^= b;) |
| 34 |
foo (10); |
| 35 |
for (;c |= c;) |
| 36 |
foo (11); |
| 37 |
d = a += b; |
| 38 |
foo (12); |
| 39 |
d = a -= a; |
| 40 |
foo (13); |
| 41 |
} |
| 42 |
|
| 43 |
template void bar<int> (int); |