Don't share ptr type in checking cond-expr with void types.
@@ -8718,10 +8718,9 @@ static void check (c2m_ctx_t c2m_ctx, node_t r, node_t context) {
} else if (void_ptr_p (t2) || void_ptr_p (t3)) {
e->type->mode = TM_PTR;
e->type->pos_node = r;
- e->type->u.ptr_type = create_type (c2m_ctx, NULL);
+ e->type->u.ptr_type = create_type (c2m_ctx, e3->type->u.ptr_type);
e->type->u.ptr_type->pos_node = r;
assert (!null_const_p (e2, t2) && !null_const_p (e3, t3));
- e->type->u.ptr_type = e3->type->u.ptr_type;
if (t2->u.ptr_type->type_qual.atomic_p || t3->u.ptr_type->type_qual.atomic_p) {
error (c2m_ctx, POS (r),
"pointer to atomic type in true or false parts of cond-expression");
