repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
FSF GCC merge 02/23/03
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.robertl
/
eb11.C
blob
307aa6a95687036a8517c2b2ccc098b2e1e7b0f1
1
// Build don't link:
2
3
template<int N1, int N2>
4
struct meta_max {
5
enum { max = (N1 > N2) ? N1 : N2 };
6
};
7
8
struct X {
9
enum {
10
a = 0,
11
n = 0
12
};
13
};
14
15
template<class T1, class T2>
16
struct Y {
17
18
enum {
19
a = T1::a + T2::a,
20
21
// NB: if the next line is changed to
22
// n = (T1::n > T2::n) ? T1::n : T2::n
23
// the problem goes away.
24
25
n = meta_max<T1::n,T2::n>::max
26
};
27
};
28
29
int z = Y<X,X>::a;