summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wcxx-compat-9.c
blob: 8a3867c11c9868b54e3dc42fb28cc127bfc2b272 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-Wc++-compat" } */

enum e { FIRST, LAST };

extern void f2 (enum e);

void
f1 ()
{
  enum e v;

  for (v = FIRST; v < LAST; ++v)  /* { dg-warning "invalid in C\[+\]\[+\]" } */
    f2 (v);
  for (v = FIRST; v < LAST; v++)  /* { dg-warning "invalid in C\[+\]\[+\]" } */
    f2 (v);
  for (v = LAST; v > FIRST; --v)  /* { dg-warning "invalid in C\[+\]\[+\]" } */
    f2 (v);
  for (v = LAST; v > FIRST; v--)  /* { dg-warning "invalid in C\[+\]\[+\]" } */
    f2 (v);
}