aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@cam.ac.uk>2000-11-13 14:14:44 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2000-11-13 14:14:44 +0000
commit19552aa5728591fdd2913ef54422e869af46852e (patch)
treef2b5f8cbfe56d1d0cc94e1b89e38e9cb318f7ece /gcc/cp
parent444ca59fa44336fbfe4744c9870bf1dd0a75093f (diff)
downloadgcc-19552aa5728591fdd2913ef54422e869af46852e.zip
gcc-19552aa5728591fdd2913ef54422e869af46852e.tar.gz
gcc-19552aa5728591fdd2913ef54422e869af46852e.tar.bz2
c-common.c (boolean_increment): New function.
* c-common.c (boolean_increment): New function. * c-common.h (enum c_tree_index): Add CTI_C_BOOL_TYPE, CTI_C_BOOL_TRUE and CTI_C_BOOL_FALSE. (c_bool_type_node, c_bool_true_node, c_bool_false_node): Define. (boolean_increment): Declare. * c-convert.c (convert): Allow for BOOLEAN_TYPE. * c-decl.c (init_decl_processing): Create boolean nodes. (finish_struct): Allow for _Bool bitfields. * c-parse.in (reswords): Add _Bool. (rid_to_yy): Allow for RID_BOOL. * c-typeck.c (default_conversion): Make booleans promote to int. (convert_arguments, build_unary_op, build_modify_expr, convert_for_assignment): Allow for booleans. * ginclude/stdbool.h: Make conforming to C99. cp: * typeck.c (build_unary_op): Use boolean_increment from c-common.c, moving the relevant code there. testsuite: * gcc.dg/c99-bool-1.c: New test. From-SVN: r37428
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck.c13
2 files changed, 6 insertions, 12 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1dfd37a..7e6d6f7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-13 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * typeck.c (build_unary_op): Use boolean_increment from
+ c-common.c, moving the relevant code there.
+
2000-11-11 Jason Merrill <jason@redhat.com>
* typeck.c (mark_addressable): Don't call put_var_into_stack.
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 06e6dee..0c628bb 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -4580,18 +4580,7 @@ build_unary_op (code, xarg, noconvert)
my patch to expand_increment. (jason) */
val = build (code, TREE_TYPE (arg), arg, inc);
#else
- if (code == POSTINCREMENT_EXPR)
- {
- arg = stabilize_reference (arg);
- val = build (MODIFY_EXPR, TREE_TYPE (arg), arg,
- boolean_true_node);
- arg = save_expr (arg);
- val = build (COMPOUND_EXPR, TREE_TYPE (arg), val, arg);
- val = build (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
- }
- else
- val = build (MODIFY_EXPR, TREE_TYPE (arg), arg,
- boolean_true_node);
+ val = boolean_increment (code, arg);
#endif
}
else