(C++) patch to decay_conversion

Jason Merrill jason@cygnus.com
Fri Oct 1 18:09:00 GMT 1999


Fixes g++.other/cond6.C.

1999-10-01  Jason Merrill  <jason@yorick.cygnus.com>

	* typeck.c (decay_conversion): Strip cv-quals from non-class rvalues.

Index: typeck.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/typeck.c,v
retrieving revision 1.219
diff -c -p -r1.219 typeck.c
*** typeck.c	1999/09/30 06:15:53	1.219
--- typeck.c	1999/10/02 01:08:27
*************** decay_conversion (exp)
*** 1789,1794 ****
--- 1789,1799 ----
        return cp_convert (ptrtype, adr);
      }
  
+   /* [basic.lval]: Class rvalues can have cv-qualified types; non-class
+      rvalues always have cv-unqualified types.  */
+   if (! CLASS_TYPE_P (type))
+     exp = cp_convert (TYPE_MAIN_VARIANT (type), exp);
+ 
    return exp;
  }
  


More information about the Gcc-patches mailing list