-O3 bug

scott snyder snyder@fnal.gov
Thu Jun 29 15:32:00 GMT 2000


This looks like the same problem i reported in

  http://gcc.gnu.org/ml/gcc-bugs/2000-03/msg01289.html


I've been using the appended patch to work around it.
Note that this patch isn't correct --- it simply attacks the symptoms
by disabing the error; that's why i haven't submitted it.  But it suffices
to get things working for me...

sss


2000-04-09  scott snyder  <sss@karma.fnal.gov>

        * decl.c (check_default_argument): Disable local variable check.

Index: decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.645
diff -u -p -r1.645 decl.c
--- decl.c      2000/06/29 14:03:09     1.645
+++ decl.c      2000/06/29 22:30:23
@@ -11974,9 +11974,11 @@ check_default_argument (decl, arg)
   var = walk_tree (&arg, local_variable_p_walkfn, NULL);
   if (var)
     {
+#if 0 /* sss */
       cp_error ("default argument `%E' uses local variable `%D'",
                arg, var);
       return error_mark_node;
+#endif
     }
 
   /* All is well.  */


More information about the Gcc-bugs mailing list