FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.robertl / eb12.C
blob5c948f11b589259d86fef14a57aece51100a9daf
1 // Build don't link: 
2 // Error: Internal Compiler Error in 2.7.2. & egcs 1.0.0
4 #ifndef NO_META_MAX
5 template<int N1, int N2>
6 struct meta_max {
7     enum { max = (N1 > N2) ? N1 : N2 };
8 };
9 #endif
11 struct X {
12     enum {
13        a = 0,
14        n = 0
15     };
18 template<class T1, class T2>
19 struct Y {
21     enum {
22        a = T1::a + T2::a,
24        // NB: if the next line is changed to
25        // n = (T1::n > T2::n) ? T1::n : T2::n
26        // the problem goes away.
28        n = meta_max<T1::n,T2::n>::max
29     };
32 int z = Y<X,X>::a;