Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.robertl/eb20.C

raw
1 // { dg-do assemble }
2 // Error: ICE on 2.7.2.3 and EGCS 1.0.0.
3
4 template<int N1, int N2>
5 struct meta_max {
6 enum { max = (N1 > N2) ? N1 : N2 };
7 };
8
9 struct X {
10 enum {
11 a = 0,
12 n = 0
13 };
14 };
15
16 template<class T1, class T2, class T3>
17 struct Y {
18
19 enum {
20 a = T1::a + T2::a + T3::a,
21 n = meta_max<meta_max<T1::n,T2::n>::max, T3::n>::max
22 };
23 };
24
25 template<class T>
26 struct Z {
27 enum {
28 a = T::a,
29 n = T::n
30 };
31 };
32
33 Z<Y<X,X,X> > z;