Comma expressions should be subjected to lvalue-conversion and thus should drop qualifiers. Fix this by calling unqualify_type() after array-to-pointer conversion. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- evaluate.c | 2 +- validation/eval/unqual-comma.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/evaluate.c b/evaluate.c index fd84205c7f2c..b6e8477185f4 100644 --- a/evaluate.c +++ b/evaluate.c @@ -1028,7 +1028,7 @@ static struct symbol *evaluate_binop(struct expression *expr) static struct symbol *evaluate_comma(struct expression *expr) { - expr->ctype = degenerate(expr->right); + expr->ctype = unqualify_type(degenerate(expr->right)); if (expr->ctype == &null_ctype) expr->ctype = &ptr_ctype; expr->flags &= expr->left->flags & expr->right->flags; diff --git a/validation/eval/unqual-comma.c b/validation/eval/unqual-comma.c index e06586cd43e3..11546d22348a 100644 --- a/validation/eval/unqual-comma.c +++ b/validation/eval/unqual-comma.c @@ -9,5 +9,4 @@ int *foo(volatile int x) /* * check-name: unqual-comma - * check-known-to-fail */ -- 2.29.2