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.