From ba9c33e8f7db8ea2b42db83e7622a2cc2fa1ec5d Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 2 Oct 1999 01:09:54 +0000 Subject: [PATCH] * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues. From-SVN: r29762 --- 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.30.2