------- Comment #4 from jakub at gcc dot gnu dot org  2007-11-23 21:11 -------
In particular, this is caused by the pt.c (tsubst) change:
@@ -8555,16 +8545,15 @@
   gcc_assert (type != unknown_type_node);

   /* Reuse typedefs.  We need to do this to handle dependent attributes,
-     specifically attribute aligned.  */
+     such as attribute aligned.  */
   if (TYPE_P (t)
       && TYPE_NAME (t)
-      && !MAYBE_TAGGED_TYPE_P (t)
-      && TREE_CODE (t) != TEMPLATE_TEMPLATE_PARM
-      && TREE_CODE (t) != UNBOUND_CLASS_TEMPLATE)
+      && TYPE_NAME (t) != TYPE_MAIN_DECL (t))
     {
       tree decl = TYPE_NAME (t);

-      if (DECL_CLASS_SCOPE_P (decl))
+      if (DECL_CLASS_SCOPE_P (decl)
+          && CLASSTYPE_TEMPLATE_INFO (DECL_CONTEXT (decl)))
         {
           tree tmpl = most_general_template (DECL_TI_TEMPLATE (decl));
           tree gen_args = tsubst (DECL_TI_ARGS (decl), args, complain,
in_decl);
           r = retrieve_specialization (tmpl, gen_args, false);
         }
       else if (DECL_FUNCTION_SCOPE_P (decl))
         r = retrieve_local_specialization (decl);
       else
         r = NULL_TREE;

In this case t is RECORD_TYPE in function scope, so MAYBE_TAGGED_TYPE_P was
true on it, but this (fn_type_unification) wasn't called from instantiate_decl
and so local_specializations is NULL.

I wonder if just
-       else if (DECL_FUNCTION_SCOPE_P (decl))
+       else if (DECL_FUNCTION_SCOPE_P (decl) && local_specializations)
wouldn't be best fix for this, there are already other places which guard
retrieve_local_specialization calls by this condition.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34206

Reply via email to