111
|
1 // PR c++/51064
|
|
2 // { dg-options "-Wparentheses" }
|
|
3
|
|
4 template<int i, int j = ((i + 7) >> 3)> class foo1 { };
|
|
5 typedef foo1<10> bar1;
|
|
6
|
|
7 template<int i, int j = (i + 7 >> 3)> class foo2 { }; // { dg-warning "suggest parentheses around '\\+'" }
|
|
8 typedef foo2<10> bar2;
|
|
9
|
|
10 template<int i, int j = (100 >> (i + 2))> class foo3 { };
|
|
11 typedef foo3<3> bar3;
|
|
12
|
|
13 template<int i, int j = (100 >> i + 2)> class foo4 { }; // { dg-warning "suggest parentheses around '\\+'" }
|
|
14 typedef foo4<3> bar4;
|
|
15
|
|
16 template<int i, int j = (i + 7) | 3> class foo5 { };
|
|
17 typedef foo5<10> bar5;
|
|
18
|
|
19 template<int i, int j = i + 7 | 3> class foo6 { }; // { dg-warning "suggest parentheses around arithmetic" }
|
|
20 typedef foo6<10> bar6;
|
|
21
|
|
22 template<int i, int j = 3 | (i + 7)> class foo7 { };
|
|
23 typedef foo7<10> bar7;
|
|
24
|
|
25 template<int i, int j = 3 | i + 7> class foo8 { }; // { dg-warning "suggest parentheses around arithmetic" }
|
|
26 typedef foo8<10> bar8;
|