#define PUSH_PARENT(stmt) \
statement_t *const prev_parent = current_parent; \
- current_parent = (stmt);
+ ((void)(current_parent = (stmt)))
#define POP_PARENT ((void)(current_parent = prev_parent))
static source_position_t null_position = { NULL, 0 };
&expression->base.source_position);
initializer_t *const result = allocate_initializer_zero(INITIALIZER_VALUE);
+#if 0
+ if (type->kind == TYPE_BITFIELD) {
+ type = type->bitfield.base_type;
+ }
+#endif
result->value.value = create_implicit_cast(expression, type);
return result;
"pointer/integer type mismatch in conditional expression ('%T' and '%T')", true_type, false_type);
result_type = pointer_type;
} else {
- type_error_incompatible("while parsing conditional",
- &expression->base.source_position, true_type, false_type);
+ if (is_type_valid(other_type)) {
+ type_error_incompatible("while parsing conditional",
+ &expression->base.source_position, true_type, false_type);
+ }
result_type = type_error_type;
}
} else {
- /* TODO: one pointer to void*, other some pointer */
-
if (is_type_valid(true_type) && is_type_valid(false_type)) {
type_error_incompatible("while parsing conditional",
&conditional->base.source_position, true_type,
value->base.type = revert_automatic_type_conversion(value);
type_t *orig_type = value->base.type;
- if (!is_type_valid(orig_type))
+ if (!is_type_valid(skip_typeref(orig_type)))
return;
set_address_taken(value, false);
/* This check does not prevent the error message in all cases of an
* prior error while parsing the expression. At least it catches the
* common case of a mistyped enum entry. */
- if (is_type_valid(end_range->base.type)) {
+ if (is_type_valid(skip_typeref(end_range->base.type))) {
errorf(pos, "case range does not reduce to an integer constant");
}
statement->case_label.is_bad = true;
eat(T_do);
- PUSH_PARENT(statement)
+ PUSH_PARENT(statement);
add_anchor_token(T_while);
statement->do_while.body = parse_loop_body(statement);