For "case unknown_var:" this prevents the subsequent error that the case label is not constant.
[r28393]
case EXPR_VA_ARG:
case EXPR_VA_COPY:
case EXPR_STATEMENT:
- case EXPR_REFERENCE:
case EXPR_UNARY_POSTFIX_INCREMENT:
case EXPR_UNARY_POSTFIX_DECREMENT:
case EXPR_UNARY_PREFIX_INCREMENT:
case EXPR_ARRAY_ACCESS:
return EXPR_CLASS_VARIABLE;
+ case EXPR_REFERENCE: {
+ type_t *const type = skip_typeref(expression->base.type);
+ return is_type_valid(type) ? EXPR_CLASS_VARIABLE : EXPR_CLASS_ERROR;
+ }
+
case EXPR_UNARY_TAKE_ADDRESS:
return is_object_with_constant_address(expression->unary.value);