Commit db327b64 by Paolo Carlini Committed by Paolo Carlini

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
parent 683c600b
2012-05-04 Paolo Carlini <paolo.carlini@oracle.com> 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
* semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy.
2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53166 PR c++/53166
* pt.c (instantiate_class_template_1): Increase / decrease * pt.c (instantiate_class_template_1): Increase / decrease
c_inhibit_evaluation_warnings around the tsubst_expr call c_inhibit_evaluation_warnings around the tsubst_expr call
......
...@@ -7757,18 +7757,16 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t, ...@@ -7757,18 +7757,16 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t,
case NOP_EXPR: case NOP_EXPR:
{ {
tree oldop = TREE_OPERAND (t, 0); tree oldop = TREE_OPERAND (t, 0);
tree op = oldop; tree op = cxx_eval_constant_expression (call, oldop,
tree to = TREE_TYPE (t); allow_non_constant, addr,
op = cxx_eval_constant_expression (call, TREE_OPERAND (t, 0), non_constant_p);
allow_non_constant, addr,
non_constant_p);
if (*non_constant_p) if (*non_constant_p)
return t; return t;
if (op == oldop) if (op == oldop)
/* We didn't fold at the top so we could check for ptr-int /* We didn't fold at the top so we could check for ptr-int
conversion. */ conversion. */
return fold (t); 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 /* Conversion of an out-of-range value has implementation-defined
behavior; the language considers it different from arithmetic behavior; the language considers it different from arithmetic
overflow, which is undefined. */ overflow, which is undefined. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment