OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / warn / Wparentheses-17.C
1 // { dg-do compile }
2 // { dg-options "-Wparentheses" }
3
4 // Template version of Wparentheses-8.C.
5
6 int foo (int);
7
8 template<class T>
9 void
10 bar (T a, T b, T c)
11 {
12   foo (a && b || c); // { dg-warning "parentheses" "correct warning" }
13   foo ((a && b) || c);
14   foo (a && (b || c));
15   foo (1 && 2 || c); // { dg-warning "parentheses" "correct warning" }
16   foo ((1 && 2) || c);
17   foo (1 && (2 || c));
18   foo (1 && 2 || 3); // { dg-warning "parentheses" "correct warning" }
19   foo ((1 && 2) || 3);
20   foo (1 && (2 || 3));
21   foo (a || b && c); // { dg-warning "parentheses" "correct warning" }
22   foo ((a || b) && c);
23   foo (a || (b && c));
24   foo (1 || 2 && c); // { dg-warning "parentheses" "correct warning" }
25   foo ((1 || 2) && c);
26   foo (1 || (2 && c));
27   foo (1 || 2 && 3); // { dg-warning "parentheses" "correct warning" }
28   foo ((1 || 2) && 3);
29   foo (1 || (2 && 3));
30 }
31
32 template void bar<int> (int, int, int); // { dg-message "instantiated" }