Backported from mainline
2017-01-04 Jakub Jelinek <jakub@redhat.com>
PR c++/78949
* typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
vector type.
* c-c++-common/Wunused-var-16.c: New test.
From-SVN: r248637
2017-05-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2017-01-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/78949
+ * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
+ vector type.
+
2016-12-02 Jakub Jelinek <jakub@redhat.com>
PR c++/78649
errstring = _("wrong type argument to bit-complement");
else if (!noconvert && CP_INTEGRAL_TYPE_P (TREE_TYPE (arg)))
arg = cp_perform_integral_promotions (arg, complain);
+ else if (!noconvert && VECTOR_TYPE_P (TREE_TYPE (arg)))
+ arg = mark_rvalue_use (arg);
break;
case ABS_EXPR:
2017-05-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2017-01-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/78949
+ * c-c++-common/Wunused-var-16.c: New test.
+
2016-12-21 Jakub Jelinek <jakub@redhat.com>
PR fortran/78866
--- /dev/null
+/* PR c++/78949 */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+typedef unsigned char V __attribute__((vector_size(16)));
+V v;
+
+void
+foo ()
+{
+ V y = {};
+ V x = {}; // { dg-bogus "set but not used" }
+ y &= ~x;
+ v = y;
+}