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: r244075
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.
+
PR c++/78693
* parser.c (cp_parser_simple_declaration): Only complain about
inconsistent auto deduction if auto_result doesn't use auto.
inform (location, "did you mean to use logical not (%<!%>)?");
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-01-04 Jakub Jelinek <jakub@redhat.com>
+ PR c++/78949
+ * c-c++-common/Wunused-var-16.c: New test.
+
PR c++/78693
* g++.dg/cpp0x/pr78693.C: New test.
--- /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;
+}