OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wparentheses-17.C] - Blame information for rev 701

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-Wparentheses" }
3
 
4
// Template version of Wparentheses-8.C.
5
 
6
int foo (int);
7
 
8
template
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); // { dg-message "required" }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.