PR c++/91819 - ICE with operator++ and enum.
[official-gcc.git] / gcc / testsuite / g++.dg / other / operator4.C
blobe7a41c01a58c1647df4261ec9a1843cc3953e443
1 // PR c++/91819 - ICE with operator++ and enum.
2 // { dg-do compile }
4 enum Foo
6   a,
7   b
8 };
10 inline Foo operator++(Foo &f, int) 
12   return f = (Foo)(f + 1);
15 int main()
17   int count = 0;
18   for (Foo f = a; f <= b; f++) {
19     count++;
20   }
21   return count;