aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2012-05-04 22:43:33 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2012-05-04 22:43:33 +0000
commitdb327b64691410726463901c8ac5b95e27fb46c4 (patch)
treee4d3e47ba00ad6cf104a4fb065dff4fc844891bd /gcc/cp/semantics.c
parent683c600b1fb53494c3cdcde83da5b3cb518cfa70 (diff)
downloadgcc-db327b64691410726463901c8ac5b95e27fb46c4.zip
gcc-db327b64691410726463901c8ac5b95e27fb46c4.tar.gz
gcc-db327b64691410726463901c8ac5b95e27fb46c4.tar.bz2
semantics.c (cxx_eval_constant_expression, [...]): Tidy.
2012-05-04 Paolo Carlini <paolo.carlini@oracle.com> * semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy. From-SVN: r187184
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 90378dc..fbb26b2 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -7757,18 +7757,16 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t,
case NOP_EXPR:
{
tree oldop = TREE_OPERAND (t, 0);
- tree op = oldop;
- tree to = TREE_TYPE (t);
- op = cxx_eval_constant_expression (call, TREE_OPERAND (t, 0),
- allow_non_constant, addr,
- non_constant_p);
+ tree op = cxx_eval_constant_expression (call, oldop,
+ allow_non_constant, addr,
+ non_constant_p);
if (*non_constant_p)
return t;
if (op == oldop)
/* We didn't fold at the top so we could check for ptr-int
conversion. */
return fold (t);
- r = fold_build1 (TREE_CODE (t), to, op);
+ r = fold_build1 (TREE_CODE (t), TREE_TYPE (t), op);
/* Conversion of an out-of-range value has implementation-defined
behavior; the language considers it different from arithmetic
overflow, which is undefined. */