From: Richard Stallman Date: Tue, 4 Aug 1992 19:36:44 +0000 (+0000) Subject: (build_conditional_expr): Merged const and volatile flags of incoming types. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1dfdf85d6047348996017e03abb14499e4ef9a89;p=gcc.git (build_conditional_expr): Merged const and volatile flags of incoming types. From-SVN: r1767 --- diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index ac8e48e3a1b..52c3c211750 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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))