Commit c5285718 by Paolo Carlini Committed by Paolo Carlini

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
parent c427220a
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> 2008-06-07 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35327 PR c++/35327
......
...@@ -14832,7 +14832,13 @@ cp_parser_class_head (cp_parser* parser, ...@@ -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; class_type = current_class_type;
/* Enter the scope indicated by the nested-name-specifier. */ /* Enter the scope indicated by the nested-name-specifier. */
pushed_scope = push_scope (nested_name_specifier); pushed_scope = push_scope (nested_name_specifier);
......
...@@ -772,7 +772,11 @@ maybe_process_partial_specialization (tree type) ...@@ -772,7 +772,11 @@ maybe_process_partial_specialization (tree type)
check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (type)); check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (type));
SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type); SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type);
if (processing_template_decl) 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)) else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type))
error ("specialization of %qT after instantiation", type); error ("specialization of %qT after instantiation", type);
......
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> 2008-06-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/36459 PR fortran/36459
......
// { dg-options "-std=c++0x" }
struct A
{
template<typename... T> struct B;
};
template<typename... T> struct A::B<T*> {}; // { dg-error "parameter packs|T" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment