aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-08-04 19:36:44 +0000
committerRichard Stallman <rms@gnu.org>1992-08-04 19:36:44 +0000
commit1dfdf85d6047348996017e03abb14499e4ef9a89 (patch)
treed37d617b218c683b7b3bea16c6474433902ac9e3 /gcc
parent16ff428bc1bdd96f26a06863d7254caeee17ecd6 (diff)
downloadgcc-1dfdf85d6047348996017e03abb14499e4ef9a89.zip
gcc-1dfdf85d6047348996017e03abb14499e4ef9a89.tar.gz
gcc-1dfdf85d6047348996017e03abb14499e4ef9a89.tar.bz2
(build_conditional_expr): Merged const and volatile flags of incoming types.
From-SVN: r1767
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-typeck.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index ac8e48e..52c3c21 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))