2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.robertl / eb11.C
blobe5f29a157916643da91bf5c61455a36c1ebf0033
1 // { dg-do assemble  }
3 template<int N1, int N2>
4 struct meta_max {
5     enum { max = (N1 > N2) ? N1 : N2 };
6 };
8 struct X {
9     enum {
10        a = 0,
11        n = 0
12     };
15 template<class T1, class T2>
16 struct Y {
18     enum {
19        a = T1::a + T2::a,
21        // NB: if the next line is changed to
22        // n = (T1::n > T2::n) ? T1::n : T2::n
23        // the problem goes away.
25        n = meta_max<T1::n,T2::n>::max
26     };
29 int z = Y<X,X>::a;