g++ 2.97 20010103 strange bug w/blitz++

Artem Khodush kaa@comail.ru
Fri Jan 5 13:44:00 GMT 2001


Temporary workaround is to back out this patch:

http://gcc.gnu.org/ml/gcc-patches/2000-12/msg00616.html

(or just one line:
    TREE_PURPOSE (t1) = TREE_PURPOSE (t2);
from pt.c)

diff -cprN gcc-old/gcc/cp/pt.c gcc-new/gcc/cp/pt.c
*** gcc-old/gcc/cp/pt.c Wed Dec  6 22:55:06 2000
--- gcc-new/gcc/cp/pt.c Mon Dec 11 01:49:15 2000
*************** check_explicit_specialization (declarato
*** 1543,1548 ****
--- 1543,1573 ----
         last_function_parms = TREE_CHAIN (last_function_parms);
       }
  
+    /* Inherit default function arguments from the template
+       DECL is specializing.  */
+    {
+      tree t1 = TYPE_ARG_TYPES (TREE_TYPE (decl));
+      tree t2 = TYPE_ARG_TYPES (TREE_TYPE (DECL_TEMPLATE_RESULT (tmpl)));
+ 
+      /* DECL may contain more parameters than TMPL due to the extra
+         in-charge parameter in constructors and destructors.  */
+      if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+        t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2);
+      if (DECL_HAS_IN_CHARGE_PARM_P (decl))
+        t1 = TREE_CHAIN (t1);
+ 
+       /* Note that we do not need to reparse default arguments, 
+   since explicit specialization cannot be declared in 
+   class scope as in [temp.expl.spec].  */
+      for (; t1 && t2; t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2))
+        {
+   if (TREE_PURPOSE (t2))
+     TREE_PURPOSE (t1) = TREE_PURPOSE (t2);
+        }
+ 
+      my_friendly_assert (t1 == NULL_TREE && t2 == NULL_TREE, 20001211);
+    }
+ 
     /* Set up the DECL_TEMPLATE_INFO for DECL.  */
     DECL_TEMPLATE_INFO (decl) = tree_cons (tmpl, targs, NULL_TREE);
  




More information about the Gcc-bugs mailing list