From: Jason Merrill Date: Sat, 1 Mar 2014 18:44:25 +0000 (-0500) Subject: re PR c++/58845 (Operator || and && broken for vectors) X-Git-Tag: releases/gcc-4.8.3~302 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bc8028fee7598a337c514c36f38a007129a381f;p=thirdparty%2Fgcc.git re PR c++/58845 (Operator || and && broken for vectors) PR c++/58845 * typeck.c (cp_build_binary_op): Sorry on vector&&vector. From-SVN: r208246 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 329389512bd4..7359cb7d8dc0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-02-28 Jason Merrill + + PR c++/58845 + * typeck.c (cp_build_binary_op): Sorry on vector&&vector. + 2014-02-26 Jason Merrill PR c++/60182 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 299e1f45352e..b8e862cb3c73 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4103,6 +4103,11 @@ cp_build_binary_op (location_t location, case TRUTH_ORIF_EXPR: case TRUTH_AND_EXPR: case TRUTH_OR_EXPR: + if (TREE_CODE (type0) == VECTOR_TYPE || TREE_CODE (type1) == VECTOR_TYPE) + { + sorry ("logical operation on vector type"); + return error_mark_node; + } result_type = boolean_type_node; break; diff --git a/gcc/testsuite/g++.dg/ext/vector27.C b/gcc/testsuite/g++.dg/ext/vector27.C new file mode 100644 index 000000000000..288e13c558d4 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/vector27.C @@ -0,0 +1,7 @@ +// PR c++/58845 + +void foo() +{ + int v __attribute__((vector_size(8))); + v = v || v; // { dg-bogus "" "" { xfail *-*-* } } +}