aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cvt.c
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@gcc.gnu.org>2015-07-25 23:15:44 +0000
committerPatrick Palka <ppalka@gcc.gnu.org>2015-07-25 23:15:44 +0000
commit9783ae5a2f44f714809321c4bb2d5534d50c19a4 (patch)
tree89d36d2f44fb506176db6a4679bb4c26d0cb8b63 /gcc/cp/cvt.c
parent39a8bd7b642eb85f66ac9c7755a371c4532e267e (diff)
downloadgcc-9783ae5a2f44f714809321c4bb2d5534d50c19a4.zip
gcc-9783ae5a2f44f714809321c4bb2d5534d50c19a4.tar.gz
gcc-9783ae5a2f44f714809321c4bb2d5534d50c19a4.tar.bz2
re PR c++/66857 (Reference not bound to lvalue)
Fix PR c++/66857 gcc/cp/ChangeLog: PR c++/66857 * cvt.c (ocp_convert): Don't call scalar_constant_value when converting to a class type. gcc/testsuite/ChangeLog: PR c++/66857 * g++.dg/init/pr66857.C: New test. From-SVN: r226228
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r--gcc/cp/cvt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 13bc1f7..6d4bd9a 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -687,7 +687,8 @@ ocp_convert (tree type, tree expr, int convtype, int flags,
}
/* FIXME remove when moving to c_fully_fold model. */
- e = scalar_constant_value (e);
+ if (!CLASS_TYPE_P (type))
+ e = scalar_constant_value (e);
if (error_operand_p (e))
return error_mark_node;