diff options
| author | Nicolai Stange <nicstange@gmail.com> | 2016-02-01 03:33:38 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-03-31 02:14:10 +0200 |
| commit | ccd9e3b5c6ab48bc03b52014a48ea53d681aa704 (patch) | |
| tree | 9a6f998f985333900315c5c2bbee099269b0bc61 /expression.c | |
| parent | 4a99724da62bfe56c6347be07cf01579b16c6e68 (diff) | |
| download | sparse-dev-ccd9e3b5c6ab48bc03b52014a48ea53d681aa704.tar.gz | |
constexpr: examine constness of preops at evaluation only
Move the whole calculation of prefix expressions' constness flags to
the evaluation phase such that expressions like
-__builtin_choose_expr(0, 0, 0)
~__builtin_choose_expr(0, 0, 0)
!__builtin_choose_expr(0, 0, 0)
can now be recognized as qualifying as integer constant expressions.
Signed-off-by: Nicolai Stange <nicstange@gmail.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'expression.c')
| -rw-r--r-- | expression.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/expression.c b/expression.c index b59af888..0332c440 100644 --- a/expression.c +++ b/expression.c @@ -450,8 +450,6 @@ struct token *primary_expression(struct token *token, struct expression **tree) expr = alloc_expression(token->pos, EXPR_PREOP); expr->op = '('; token = parens_expression(token, &expr->unop, "in expression"); - if (expr->unop) - expr->flags = expr->unop->flags; break; } if (token->special == '[' && lookup_type(token->next)) { @@ -663,7 +661,6 @@ static struct token *unary_expression(struct token *token, struct expression **t unary = alloc_expression(token->pos, EXPR_PREOP); unary->op = token->special; unary->unop = unop; - unary->flags = unop->flags & ~CEF_CONST_MASK; *tree = unary; return next; } |
