summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-27 10:00:48 +0000
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-27 10:00:48 +0000
commit73fd9cbeb30ff9bf789277073e945c1eb3198af8 (patch)
tree59afda12c182fc1e142f96b4e40f4b06d86d1a7a /gcc/cp
parent2dda221d048928227d5230ef6a02bdb3944b8c7c (diff)
downloadgcc-73fd9cbeb30ff9bf789277073e945c1eb3198af8.tar.gz
Handle vector increment/decrement in build_unary_op
2013-11-27 Tom de Vries <tom@codesourcery.com> Marc Glisse <marc.glisse@inria.fr> PR c++/59032 * c-typeck.c (build_unary_op): Allow vector increment and decrement. * typeck.c (cp_build_unary_op): Allow vector increment and decrement. * c-c++-common/pr59032.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205439 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/typeck.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8c5ec0a9556..4d4e0e4b22f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,6 +1,12 @@
2013-11-27 Tom de Vries <tom@codesourcery.com>
Marc Glisse <marc.glisse@inria.fr>
+ PR c++/59032
+ * typeck.c (cp_build_unary_op): Allow vector increment and decrement.
+
+2013-11-27 Tom de Vries <tom@codesourcery.com>
+ Marc Glisse <marc.glisse@inria.fr>
+
PR middle-end/59037
* semantics.c (cxx_fold_indirect_ref): Don't create out-of-bounds
BIT_FIELD_REF.
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index a4da037db33..9f9f7b6775b 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5748,7 +5748,9 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
inc = cxx_sizeof_nowarn (TREE_TYPE (argtype));
}
else
- inc = integer_one_node;
+ inc = VECTOR_TYPE_P (argtype)
+ ? build_one_cst (argtype)
+ : integer_one_node;
inc = cp_convert (argtype, inc, complain);