1// { dg-do assemble  }
2// Error: Internal Compiler Error in 2.7.2. & egcs 1.0.0
3
4#ifndef NO_META_MAX
5template<int N1, int N2>
6struct meta_max {
7    enum { max = (N1 > N2) ? N1 : N2 };
8};
9#endif
10
11struct X {
12    enum {
13       a = 0,
14       n = 0
15    };
16};
17
18template<class T1, class T2>
19struct Y {
20
21    enum {
22       a = T1::a + T2::a,
23
24       // NB: if the next line is changed to
25       // n = (T1::n > T2::n) ? T1::n : T2::n
26       // the problem goes away.
27
28       n = meta_max<T1::n,T2::n>::max
29    };
30};
31
32int z = Y<X,X>::a;
33