aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mmitchel@gcc.gnu.org>1998-04-22 21:02:15 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1998-04-22 21:02:15 +0000
commitf5710887ad5b831a63fcd08babf0a2ae171f09e4 (patch)
tree039ee5c46d299afab29cb1a73663c1f40f275d96
parentdb2767b644667cdb0beefc7c98c643e605512405 (diff)
downloadgcc-f5710887ad5b831a63fcd08babf0a2ae171f09e4.zip
gcc-f5710887ad5b831a63fcd08babf0a2ae171f09e4.tar.gz
gcc-f5710887ad5b831a63fcd08babf0a2ae171f09e4.tar.bz2
*** empty log message ***
From-SVN: r19379
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/expr5.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec17.C44
2 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/expr5.C b/gcc/testsuite/g++.old-deja/g++.pt/expr5.C
new file mode 100644
index 0000000..4cb5078
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/expr5.C
@@ -0,0 +1,10 @@
+// Build don't link:
+
+template <class T, int i>
+struct S1;
+
+template <class T, int i, int j>
+struct S2
+{
+ typedef typename S1<T, (i >= j ? 0 : 1) >::type type;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec17.C b/gcc/testsuite/g++.old-deja/g++.pt/spec17.C
new file mode 100644
index 0000000..3e3dd63
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec17.C
@@ -0,0 +1,44 @@
+// Build don't link:
+
+template<class T>
+struct Foo { };
+
+template<class T1, class T2>
+struct BT { };
+
+template<class T1, class T2>
+struct BT< Foo<T1>, Foo<T2> > { static const int i = 1; };
+
+template<class T1, class T2>
+struct BT< T1, Foo<T2> > { static const int i = 2; };
+
+template<class T1, class T2>
+struct BT< Foo<T1>, T2 > { static const int i = 3; };
+
+template<class T1, class T2>
+int foo(Foo<T1>, Foo<T2>)
+{
+ return 1;
+}
+
+template<class T1, class T2>
+int foo(T1, Foo<T2>)
+{
+ return 2;
+}
+
+template<class T1, class T2>
+int foo(Foo<T1>, T2)
+{
+ return 3;
+}
+
+void f()
+{
+ BT< double, Foo<int> >::i;
+ BT< Foo<int>, Foo<int> >::i;
+ BT< Foo<int>, float >::i;
+ foo(1.0, Foo<int>());
+ foo(Foo<int>(), Foo<int>());
+ foo(Foo<int>(), 1.0);
+}