summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.robertl/eb11.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb11.C29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C
new file mode 100644
index 000000000..e5f29a157
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb11.C
@@ -0,0 +1,29 @@
+// { dg-do assemble }
+
+template<int N1, int N2>
+struct meta_max {
+ enum { max = (N1 > N2) ? N1 : N2 };
+};
+
+struct X {
+ enum {
+ a = 0,
+ n = 0
+ };
+};
+
+template<class T1, class T2>
+struct Y {
+
+ enum {
+ a = T1::a + T2::a,
+
+ // NB: if the next line is changed to
+ // n = (T1::n > T2::n) ? T1::n : T2::n
+ // the problem goes away.
+
+ n = meta_max<T1::n,T2::n>::max
+ };
+};
+
+int z = Y<X,X>::a;