diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1999-10-02 01:09:54 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-10-01 21:09:54 -0400 |
commit | ba9c33e8f7db8ea2b42db83e7622a2cc2fa1ec5d (patch) | |
tree | cdb4acfc5245d548aa135bc86e4c42f48981f47a | |
parent | 1bd83869f2434d184202618f1d086068d4a01bb6 (diff) | |
download | gcc-ba9c33e8f7db8ea2b42db83e7622a2cc2fa1ec5d.zip gcc-ba9c33e8f7db8ea2b42db83e7622a2cc2fa1ec5d.tar.gz gcc-ba9c33e8f7db8ea2b42db83e7622a2cc2fa1ec5d.tar.bz2 |
* typeck.c (decay_conversion): Strip cv-quals from non-class rvalues.
From-SVN: r29762
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 5 |
2 files changed, 9 insertions, 0 deletions
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 <jason@yorick.cygnus.com> + + * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues. + 1999-10-01 Mark Mitchell <mark@codesourcery.com> * 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; } |