This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48574] [4.6/4.7 Regression] ICE
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 13 Apr 2011 07:48:43 +0000
- Subject: [Bug c++/48574] [4.6/4.7 Regression] ICE
- Auto-submitted: auto-generated
- References: <bug-48574-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48574
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-13 07:48:13 UTC ---
--- gcc/cp/class.c.jj 2011-03-31 08:50:52.000000000 +0200
+++ gcc/cp/class.c 2011-04-13 09:41:42.000000000 +0200
@@ -5827,7 +5827,8 @@ fixed_type_or_null (tree instance, int *
switch (TREE_CODE (instance))
{
case INDIRECT_REF:
- if (POINTER_TYPE_P (TREE_TYPE (instance)))
+ if ((processing_template_decl && TREE_TYPE (instance) == NULL_TREE)
+ || POINTER_TYPE_P (TREE_TYPE (instance)))
return NULL_TREE;
else
return RECUR (TREE_OPERAND (instance, 0));
fixes the ICE, but I doubt it is the right fix. I think other dependent
types (e.g. TEMPLATE_TYPE_PARM or TEMPLATE_TEMPLATE_PARM at least) can be
potentially a POINTER_TYPE_P too. On the other side calling dependent_type_p
(TREE_TYPE (instance)) || POINTER_TYPE_P (TREE_TYPE (instance))) here would
return NULL even for dependent types that will certainly not be
POINTER_TYPE_Ps.