2018-06-22 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2018-05-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/85952
+ * init.c (build_aggr_init): For structured binding initialized from
+ array call mark_rvalue_use on the initializer.
+
2018-05-11 Jakub Jelinek <jakub@redhat.com>
PR c/85696
if (VAR_P (exp) && DECL_DECOMPOSITION_P (exp))
{
from_array = 1;
+ init = mark_rvalue_use (init);
if (init && DECL_P (init)
&& !(flags & LOOKUP_ONLYCONVERTING))
{
PR c++/85662
* g++.dg/ext/offsetof3.C: New test.
+ 2018-05-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/85952
+ * g++.dg/warn/Wunused-var-33.C: New test.
+
2018-05-11 Jakub Jelinek <jakub@redhat.com>
PR c/85696
--- /dev/null
+// PR c++/85952
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wunused-but-set-variable" }
+
+int
+foo ()
+{
+ int a[2] = {1, 2}; // { dg-bogus "set but not used" } */
+ auto [x, y] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } }
+ return x + y;
+}
+
+struct S { int d, e; };
+
+int
+bar ()
+{
+ S a = {1, 2};
+ auto [x, y] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } }
+ return x + y;
+}
+
+int
+baz ()
+{
+ S a = {1, 2};
+ auto & [x, y] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } }
+ return x + y;
+}
+
+int
+qux ()
+{
+ int a[2] = {1, 2};
+ auto & [x, y] = a; // { dg-warning "decomposition declaration only available with" "" { target c++14_down } }
+ return x + y;
+}