This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ Patch] PR 35242


Hi,

one more ICE. Fix tested x86_64-linux, OK for mainline?

Paolo.

/////////////////
/cp
2008-06-07  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-07  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/35242
        * g++.dg/cpp0x/vt-35242.C: New.
Index: testsuite/g++.dg/cpp0x/vt-35242.C
===================================================================
*** testsuite/g++.dg/cpp0x/vt-35242.C	(revision 0)
--- testsuite/g++.dg/cpp0x/vt-35242.C	(revision 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" }
Index: cp/pt.c
===================================================================
*** cp/pt.c	(revision 136523)
--- cp/pt.c	(working copy)
*************** maybe_process_partial_specialization (tr
*** 772,778 ****
  	  check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (type));
  	  SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type);
  	  if (processing_template_decl)
! 	    push_template_decl (TYPE_MAIN_DECL (type));
  	}
        else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type))
  	error ("specialization of %qT after instantiation", type);
--- 772,782 ----
  	  check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (type));
  	  SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type);
  	  if (processing_template_decl)
! 	    {
! 	      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);
Index: cp/parser.c
===================================================================
*** cp/parser.c	(revision 136523)
--- cp/parser.c	(working copy)
*************** cp_parser_class_head (cp_parser* parser,
*** 14832,14838 ****
  	    }
  	}
  
!       maybe_process_partial_specialization (TREE_TYPE (type));
        class_type = current_class_type;
        /* Enter the scope indicated by the nested-name-specifier.  */
        pushed_scope = push_scope (nested_name_specifier);
--- 14832,14844 ----
  	    }
  	}
  
!       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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]