diff options
author | ppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-25 23:15:44 +0000 |
---|---|---|
committer | ppalka <ppalka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-25 23:15:44 +0000 |
commit | 0a7452a8e75dc2459e14b9b360a7d503423a9972 (patch) | |
tree | 89d36d2f44fb506176db6a4679bb4c26d0cb8b63 /gcc/cp/cvt.c | |
parent | cce0626467668fe21af67eb5ae7d5239deaf1a61 (diff) | |
download | gcc-0a7452a8e75dc2459e14b9b360a7d503423a9972.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226228 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 13bc1f7766f..6d4bd9aac25 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; |