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]

Re: PATCH: fix Obj-C++ typo



On 19 Jan 2005, at 16.49, Matt Austern wrote:


I'm almost willing to commit this as obvious, but,...

OK to commit to mainline?

--Matt



* typeck.c (comptypes): Handle return code from objc_comptypes correctly.

Ah, thanks for finding this. :-(


I have no C++ approval privileges, of course, but would point out that in the C++ (i.e., non-ObjC++) case, the 'return' statement never gets taken, either with your patch or without, so this looks perfectly safe.

--Zem


Index: gcc/cp/typeck.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v retrieving revision 1.606 diff -p -r1.606 typeck.c *** gcc/cp/typeck.c 22 Dec 2004 18:00:39 -0000 1.606 --- gcc/cp/typeck.c 20 Jan 2005 00:47:52 -0000 *************** comptypes (tree t1, tree t2, int strict) *** 1020,1026 ****

        /* We may be dealing with Objective-C instances...  */
        if (TREE_CODE (t1) == RECORD_TYPE
!         && (retval = objc_comptypes (t1, t2, 0) >= 0))
           return retval;
        /* ...but fall through if we are not.  */

--- 1020,1026 ----

        /* We may be dealing with Objective-C instances...  */
        if (TREE_CODE (t1) == RECORD_TYPE
!         && ((retval = objc_comptypes (t1, t2, 0)) >= 0))
           return retval;
        /* ...but fall through if we are not.  */



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