aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-07-19 17:09:40 +0200
committerEugen Wissner <belka@caraus.de>2026-07-19 18:30:21 +0200
commitcdbc1695a93910df5729779de31912a3b4b4172b (patch)
tree43a4c5a192df7060f8a36c75d339be7ac5722f72 /gcc
parentcd2ee0c97348444779a155909b7ec78d89cfd2e0 (diff)
downloadelna-cdbc1695a93910df5729779de31912a3b4b4172b.tar.gz
Support unary plus operation
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gcc/elna-generic.cc24
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;
}
}