| 1 |
// PR c++/91819 - ICE with operator++ and enum. |
| 2 |
// { dg-do compile } |
| 3 |
|
| 4 |
enum Foo |
| 5 |
{ |
| 6 |
a, |
| 7 |
b |
| 8 |
}; |
| 9 |
|
| 10 |
inline Foo operator++(Foo &f, int) |
| 11 |
{ |
| 12 |
return f = (Foo)(f + 1); |
| 13 |
} |
| 14 |
|
| 15 |
int main() |
| 16 |
{ |
| 17 |
int count = 0; |
| 18 |
for (Foo f = a; f <= b; f++) { |
| 19 |
count++; |
| 20 |
} |
| 21 |
return count; |
| 22 |
} |