1 /* { dg-do compile } */ 2 /* { dg-options "-Wc++-compat" } */ 3 4 enum e { FIRST, LAST }; 5 6 extern void f2 (enum e); 7 8 void f1()9f1 () 10 { 11 enum e v; 12 13 for (v = FIRST; v < LAST; ++v) /* { dg-warning "invalid in C\[+\]\[+\]" } */ 14 f2 (v); 15 for (v = FIRST; v < LAST; v++) /* { dg-warning "invalid in C\[+\]\[+\]" } */ 16 f2 (v); 17 for (v = LAST; v > FIRST; --v) /* { dg-warning "invalid in C\[+\]\[+\]" } */ 18 f2 (v); 19 for (v = LAST; v > FIRST; v--) /* { dg-warning "invalid in C\[+\]\[+\]" } */ 20 f2 (v); 21 } 22