This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

"Obvious" change in cp/decl.c


I claim that this is an obvious patch:
   Index: decl.c
   ===================================================================
   RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
   retrieving revision 1.939
   diff -u -r1.939 decl.c
   --- decl.c	1 Oct 2002 18:27:53 -0000	1.939
   +++ decl.c	1 Oct 2002 23:18:06 -0000
   @@ -1793,7 +1793,7 @@
      int result = 0;

      for (; decl ; decl = TREE_CHAIN (decl))
   -    result != (*f) (&decl, d);
   +    result |= (*f) (&decl, d);

      return result;
    }

Any disagreement?

As it stands, 'result' can never get set to a nonzero value.  I
don't have a test case showing that this causes a user-visible
bug, but I could probably find one.  It would probably involve
something like a class template with several virtual member
functions, where explicitly instantiating the key function doesn't
trigger instantiation of the other virtual member functions.

			--Matt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]