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]

Re: [PATCH] Fix PR c++/40557: ICE with template union


Hi Jason,

Pedantically, I think CLASS_TYPE_P is the right test.
You're right, thanks.

I attach a patch that fixes this. I've successfully regtested it on
x86_64-apple-darwin-9. Is it OK for the trunk?

Best regards,
Simon

2008-07-08  Simon Martin  <simartin@users.sourceforge.net>
	Jason Merrill  <jason@redhat.com>

	* pt.c (perform_typedefs_access_check, get_types_needing_access_check,
	append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.



Index: gcc/cp/pt.c
===================================================================
--- gcc/cp/pt.c	(revision 149375)
+++ gcc/cp/pt.c	(working copy)
@@ -7143,7 +7143,7 @@
   tree t;
 
   if (!tmpl
-      || (!RECORD_OR_UNION_CODE_P (TREE_CODE (tmpl))
+      || (!CLASS_TYPE_P (tmpl)
 	  && TREE_CODE (tmpl) != FUNCTION_DECL))
     return;
 
@@ -17512,7 +17512,7 @@
   if (!(ti = get_template_info (t)))
     return NULL_TREE;
 
-  if (RECORD_OR_UNION_CODE_P (TREE_CODE (t))
+  if (CLASS_TYPE_P (t)
       || TREE_CODE (t) == FUNCTION_DECL)
     {
       if (!TI_TEMPLATE (ti))
@@ -17545,7 +17545,7 @@
     return;
 
   gcc_assert ((TREE_CODE (t) == FUNCTION_DECL
-	       || RECORD_OR_UNION_CODE_P (TREE_CODE (t)))
+	       || CLASS_TYPE_P (t))
 	      && type_decl
 	      && TREE_CODE (type_decl) == TYPE_DECL
 	      && scope);




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