diff options
author | Jason Merrill <jason@redhat.com> | 2018-01-29 11:56:28 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-01-29 11:56:28 -0500 |
commit | 82be290b3b9450897c1f328f07ffa71839f4582c (patch) | |
tree | 9b938cae10dedc4020c96bea53cbe1b0ae539bbd /gcc/cp | |
parent | b9921bf0a01418b70e7869c45fd0c3cb7c50f528 (diff) | |
download | gcc-82be290b3b9450897c1f328f07ffa71839f4582c.zip gcc-82be290b3b9450897c1f328f07ffa71839f4582c.tar.gz gcc-82be290b3b9450897c1f328f07ffa71839f4582c.tar.bz2 |
PR c++/83942 - wrong unused warning with static_cast.
* cvt.c (ocp_convert): Call mark_rvalue_use.
From-SVN: r257155
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c526645..90e8ff1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-01-29 Jason Merrill <jason@redhat.com> + + PR c++/83942 - wrong unused warning with static_cast. + * cvt.c (ocp_convert): Call mark_rvalue_use. + 2018-01-26 Jason Merrill <jason@redhat.com> PR c++/83956 - wrong dtor error with anonymous union diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 7ed2aad..3ab3e2e 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -691,7 +691,10 @@ ocp_convert (tree type, tree expr, int convtype, int flags, /* FIXME remove when moving to c_fully_fold model. */ if (!CLASS_TYPE_P (type)) - e = scalar_constant_value (e); + { + e = mark_rvalue_use (e); + e = scalar_constant_value (e); + } if (error_operand_p (e)) return error_mark_node; |