aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2008-06-08 21:25:49 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-06-08 21:25:49 +0000
commitc528571847d2d2c4b6478dac883951b540b18a9c (patch)
tree07d8336646903840ad629669ae3cfcc1cae53c3a
parentc427220a8caf5221617d92fd9e70a92d1f8ffe55 (diff)
downloadgcc-c528571847d2d2c4b6478dac883951b540b18a9c.zip
gcc-c528571847d2d2c4b6478dac883951b540b18a9c.tar.gz
gcc-c528571847d2d2c4b6478dac883951b540b18a9c.tar.bz2
re PR c++/35242 (ICE with invalid specialization of variadic template)
/cp 2008-06-08 Paolo Carlini <paolo.carlini@oracle.com> PR c++/35242 * pt.c (maybe_process_partial_specialization): Check the tree returned by push_template_decl for error_mark_node. * parser.c (cp_parser_class_head): Likewise, check the tree returned by the latter. /testsuite 2008-06-08 Paolo Carlini <paolo.carlini@oracle.com> PR c++/35242 * g++.dg/cpp0x/vt-35242.C: New. From-SVN: r136569
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/parser.c8
-rw-r--r--gcc/cp/pt.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/vt-35242.C7
5 files changed, 32 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index fb79f47..74ae4ae 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2008-06-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/35242
+ * pt.c (maybe_process_partial_specialization): Check the tree
+ returned by push_template_decl for error_mark_node.
+ * parser.c (cp_parser_class_head): Likewise, check the tree
+ returned by the latter.
+
2008-06-07 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35327
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 5ca1bd7..12d1a2d 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -14832,7 +14832,13 @@ cp_parser_class_head (cp_parser* parser,
}
}
- maybe_process_partial_specialization (TREE_TYPE (type));
+ if (maybe_process_partial_specialization (TREE_TYPE (type))
+ == error_mark_node)
+ {
+ type = NULL_TREE;
+ goto done;
+ }
+
class_type = current_class_type;
/* Enter the scope indicated by the nested-name-specifier. */
pushed_scope = push_scope (nested_name_specifier);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f141b74..eb4a7b7e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -772,7 +772,11 @@ maybe_process_partial_specialization (tree type)
check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (type));
SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type);
if (processing_template_decl)
- push_template_decl (TYPE_MAIN_DECL (type));
+ {
+ if (push_template_decl (TYPE_MAIN_DECL (type))
+ == error_mark_node)
+ return error_mark_node;
+ }
}
else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type))
error ("specialization of %qT after instantiation", type);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 84ee84c..ee3af09 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/35242
+ * g++.dg/cpp0x/vt-35242.C: New.
+
2008-06-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/36459
diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-35242.C b/gcc/testsuite/g++.dg/cpp0x/vt-35242.C
new file mode 100644
index 0000000..9cc859b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/vt-35242.C
@@ -0,0 +1,7 @@
+// { dg-options "-std=c++0x" }
+struct A
+{
+ template<typename... T> struct B;
+};
+
+template<typename... T> struct A::B<T*> {}; // { dg-error "parameter packs|T" }