aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-11-15 10:53:02 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2008-11-15 10:53:02 +0100
commitb70cef5d743a294b00b863f8caf80342f33f8100 (patch)
tree1e5e94a256aac8b6bf173d2f80f06cb0c584e226 /gcc/cp
parent91ddf5a1e710ef71f8f4e0f4d84dc852d15eea89 (diff)
downloadgcc-b70cef5d743a294b00b863f8caf80342f33f8100.zip
gcc-b70cef5d743a294b00b863f8caf80342f33f8100.tar.gz
gcc-b70cef5d743a294b00b863f8caf80342f33f8100.tar.bz2
re PR c++/37561 (Revision 140405 caused g++.old-deja/g++.mike/warn1.C)
PR c++/37561 * c-typeck.c (build_unary_op): Don't call get_unwidened. Use argtype instead of result_type. * typeck.c (cp_build_unary_op): Don't call get_unwidened. Use argtype instead of result_type. * gcc.dg/pr37561.c: New test. * g++.dg/other/increment1.C: New test. From-SVN: r141881
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/typeck.c8
2 files changed, 8 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a4dbc86..e6fbdfb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/37561
+ * typeck.c (cp_build_unary_op): Don't call get_unwidened. Use
+ argtype instead of result_type.
+
2008-11-14 Jason Merrill <jason@redhat.com>
PR c++/38030
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 321f76b..7595b58 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -4348,12 +4348,8 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
{
tree inc;
- tree declared_type;
- tree result_type = TREE_TYPE (arg);
+ tree declared_type = unlowered_expr_type (arg);
- declared_type = unlowered_expr_type (arg);
-
- arg = get_unwidened (arg, 0);
argtype = TREE_TYPE (arg);
/* ARM $5.2.5 last annotation says this should be forbidden. */
@@ -4427,7 +4423,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
val = build2 (code, TREE_TYPE (arg), arg, inc);
TREE_SIDE_EFFECTS (val) = 1;
- return cp_convert (result_type, val);
+ return val;
}
case ADDR_EXPR: