/* Handle parameterized types (templates) for GNU C++.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+ 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing.
Rewritten by Jason Merrill (jason@cygnus.com).
int nargs = TREE_VEC_LENGTH (inner_args);
int ntparms;
int i;
- int did_error_intro = 0;
+ bool did_error_intro = false;
struct template_parm_data tpd;
struct template_parm_data tpd2;
if (!did_error_intro)
{
error ("template parameters not used in partial specialization:");
- did_error_intro = 1;
+ did_error_intro = true;
}
error (" %qD", TREE_VALUE (TREE_VEC_ELT (inner_parms, i)));
}
+ if (did_error_intro)
+ return error_mark_node;
+
/* [temp.class.spec]
The argument list of the specialization shall not be identical to
+2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/34272
+ PR c++/43630
+ PR c++/34491
+ * g++.dg/template/crash97.C: New.
+ * g++.dg/template/crash98.C: Likewise.
+ * g++.dg/template/crash99.C: Likewise.
+ * g++.dg/cpp0x/pr31439.C: Adjust.
+ * g++.dg/template/crash95.C: Likewise.
+
2010-05-11 Jakub Jelinek <jakub@redhat.com>
PR middle-end/44071
// { dg-options "-std=c++0x" }
-template<typename...> struct A;
+template<typename...> struct A; // { dg-error "declaration" }
template<char> struct A<> {}; // { dg-error "not used in partial specialization|anonymous" }
-template<typename T, typename... U> struct A<T, U...> : A<U...> {};
+template<typename T, typename... U> struct A<T, U...> : A<U...> {}; // { dg-error "incomplete type" }
A<int> a;
--- /dev/null
+// PR c++/34272
+
+template<typename> struct A {};
+
+template<typename> struct A<int> // { dg-error "not used|template\\-parameter" }
+{
+ template<int> void foo();
+};
+
+void bar()
+{
+ A<int> a; // { dg-error "incomplete type" }
+ a.foo<0>(); // { dg-error "expected" }
+}