From: Jason Merrill Date: Sat, 2 Oct 1999 01:09:54 +0000 (+0000) Subject: * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba9c33e8f7db8ea2b42db83e7622a2cc2fa1ec5d;p=platform%2Fupstream%2Fgcc.git * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues. From-SVN: r29762 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bef91e9..814e211 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +1999-10-01 Jason Merrill + + * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues. + 1999-10-01 Mark Mitchell * pt.c (tsubst_decl): If the type of a template instantiation is diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 4a28de2..5395d7d 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1789,6 +1789,11 @@ decay_conversion (exp) 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; }