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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [ext/] [case-range3.C] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// { dg-do compile }
2
// Tests if case ranges (a GNU extension) emit errors in ISO mode
3
// { dg-options "-pedantic" }
4
const int low = -2;
5
const int high = 15;
6
 
7
template 
8
T f2 (T i)
9
{
10
  switch (i)
11
  {
12
    case low ... high : return i + 1; // { dg-warning "non-standard" }
13
    default : return 0;
14
  }
15
}
16
 
17
int f (int i)
18
{
19
  switch (i) {
20
    case 1 ... 10: return i + 1;      // { dg-warning "non-standard" }
21
    default: return f2 (i);           // { dg-message "instantiated" }
22
  }
23
}

powered by: WebSVN 2.1.0

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