summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/enum7.C
blob: e81376124c78d36d0f3afac8267a621cfb840b77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { dg-do run  }
template <int I>
int f()
{
  enum E { a = I };

  struct S {
    int g() {
      E e;
      e = a;
      return (int) e;
    }
  };

  S s;

  return s.g();
}


int main()
{
  if (f<7>() != 7)
    return 1;
  if (f<-3>() != -3)
    return 1;
  return 0;
}