aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr88217.C
blob: b0506acabd736d49b4677529cea80513bf165cf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { dg-do compile { target c++11 } }
// { dg-options "-O2 -fstrict-enums -fno-tree-forwprop -fno-tree-fre" }

extern "C" int printf (const char *, ...);

enum E { e1, e2, e3, X };
E operator*(E e) { return e; }
E begin(E e) { return e; }
E end(E e) { return X; }
E operator++(E& e) { return e = E(e+1); }

int main()
{
  for (auto e: e1)
    {
      printf ("%d ", e);
    }
}