Patch to make objective-c++ conform to c++'s const-fold rules

Fariborz Jahanian fjahanian@apple.com
Fri Jun 9 19:58:00 GMT 2006


As part of our testing, we test g++ tests in objective-c++ mode. One  
test, g++.dg/expr/lval2.C fails. This trivial patch fixes it and Mike  
Stump has approved it. But I wait and see if one of the fold-const.c  
maintainers can approve this too.

- Fariborz (fjahanian@apple.com)

Index: fold-const.c
===================================================================
--- fold-const.c        (revision 114517)
+++ fold-const.c        (working copy)
@@ -4531,7 +4531,8 @@
        /* Avoid these transformations if the COND_EXPR may be used
          as an lvalue in the C++ front-end.  PR c++/19199.  */
        && (in_gimple_form
-         || strcmp (lang_hooks.name, "GNU C++") != 0
+         || (strcmp (lang_hooks.name, "GNU C++") != 0
+             && strcmp (lang_hooks.name, "GNU Objective-C++") != 0)
           || ! maybe_lvalue_p (arg1)
           || ! maybe_lvalue_p (arg2)))
      {



More information about the Gcc-patches mailing list