From cc2a360d26006241776854ad2bf512259c3d2f97 Mon Sep 17 00:00:00 2001 From: jason Date: Sat, 2 Oct 1999 01:09:54 +0000 Subject: [PATCH] * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29762 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/typeck.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bef91e9492c..814e21178c3 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 4a28de2b48e..5395d7d42ee 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; } -- 2.11.0