re PR c++/82075 (structured binding fails with empty base class)
authorJakub Jelinek <jakub@redhat.com>
Fri, 8 Mar 2019 18:31:27 +0000 (19:31 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 8 Mar 2019 18:31:27 +0000 (19:31 +0100)
PR c++/82075
* g++.dg/cpp1z/decomp49.C: New test.

From-SVN: r269504

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/decomp49.C [new file with mode: 0644]

index 13b91c7965ca0d84d61170488c87cbe62382eb04..baa3126e6ad82c069eea9834e6be65087d195bd7 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/82075
+       * g++.dg/cpp1z/decomp49.C: New test.
+
 2019-03-08  Andre Vieira  <andre.simoesdiasvieira@arm.com>
 
        * gcc.target/arm/f16_f64_conv_no_dp.c: New test.
diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp49.C b/gcc/testsuite/g++.dg/cpp1z/decomp49.C
new file mode 100644 (file)
index 0000000..525eb45
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/82075
+// { dg-do run { target c++11 } }
+// { dg-options "" }
+
+struct B { };
+struct D : B { int i; };
+
+int
+main ()
+{
+  auto [i] = D{};      // { dg-warning "only available with" "" { target c++14_down } }
+  if (i != 0)
+    __builtin_abort ();
+}