diff options
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/gcc/elna-generic.cc | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/gcc/gcc/elna-generic.cc b/gcc/gcc/elna-generic.cc index ae04be9..b13fd2f 100644 --- a/gcc/gcc/elna-generic.cc +++ b/gcc/gcc/elna-generic.cc @@ -659,36 +659,24 @@ namespace elna::gcc this->current_expression = build1_loc(location, TRUTH_NOT_EXPR, boolean_type_node, this->current_expression); } - else if (is_integral_type(operand_type)) + else { this->current_expression = build1_loc(location, BIT_NOT_EXPR, operand_type, this->current_expression); } - else - { - error_at(location, "type '%s' cannot be negated", - print_type(operand_type).c_str()); - this->current_expression = error_mark_node; - } break; } case boot::unary_operator::minus: { tree operand_type = TREE_TYPE(this->current_expression); - if (is_integral_type(operand_type)) - { - this->current_expression = fold_build1_loc(location, NEGATE_EXPR, - operand_type, this->current_expression); - } - else - { - error_at(location, "type '%s' cannot be negated", - print_type(operand_type).c_str()); - this->current_expression = error_mark_node; - } + this->current_expression = fold_build1_loc(location, NEGATE_EXPR, + operand_type, this->current_expression); break; } + case boot::unary_operator::plus: + // Identity: operand already in current_expression. + break; } } |
