pt.c (tsubst_aggr_type): Bail if creating the argvec fails.
authorJason Merrill <jason@gcc.gnu.org>
Wed, 9 Aug 2000 18:55:42 +0000 (14:55 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 9 Aug 2000 18:55:42 +0000 (14:55 -0400)
        * pt.c (tsubst_aggr_type): Bail if creating the argvec fails.
        (tsubst_template_arg_vector): Likewise.

From-SVN: r35592

gcc/testsuite/g++.old-deja/g++.pt/explarg1.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explarg1.C b/gcc/testsuite/g++.old-deja/g++.pt/explarg1.C
new file mode 100644 (file)
index 0000000..4a1c66b
--- /dev/null
@@ -0,0 +1,21 @@
+// Bug: g++ generates an error trying to generate the first foo<int>, when
+// it should silently fail and go on to the next one.
+
+template<class T, typename U> class A { };
+
+template<class T> void
+foo(const A<T,typename T::N>&);
+
+template<typename T>
+class B { };
+
+template<typename T> void
+foo(B<T> const &) { }
+
+int
+main(void)
+{
+  B<int> sa;
+
+  foo<int> (sa);
+}