This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR c++/40557: ICE with template union
- From: Simon Martin <simartin at users dot sourceforge dot net>
- To: Jason Merrill <jason at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, dodji at redhat dot com
- Date: Thu, 09 Jul 2009 07:25:20 +0200
- Subject: Re: [PATCH] Fix PR c++/40557: ICE with template union
- References: <4A4F56E3.406@users.sourceforge.net> <4A520D4B.2000207@redhat.com>
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);