(build_conditional_expr): Merged const and volatile flags of incoming types.

From-SVN: r1767
This commit is contained in:
Richard Stallman 1992-08-04 19:36:44 +00:00
parent 16ff428bc1
commit 1dfdf85d60
1 changed files with 6 additions and 0 deletions

View File

@ -3538,6 +3538,12 @@ build_conditional_expr (ifexp, op1, op2)
}
}
/* Merge const and volatile flags of the incoming types. */
result_type
= build_type_variant (result_type,
TYPE_READONLY (op1) || TYPE_READONLY (op2),
TYPE_VOLATILE (op1) || TYPE_VOLATILE (op2));
if (result_type != TREE_TYPE (op1))
op1 = convert (result_type, op1);
if (result_type != TREE_TYPE (op2))