]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/82075 (structured binding fails with empty base class)
authorJakub Jelinek <jakub@redhat.com>
Fri, 30 Aug 2019 12:14:10 +0000 (14:14 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 30 Aug 2019 12:14:10 +0000 (14:14 +0200)
Backported from mainline
2019-03-08  Jakub Jelinek  <jakub@redhat.com>

PR c++/82075
* g++.dg/cpp1z/decomp49.C: New test.

From-SVN: r275125

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

index 18693b02603d480c026ece46831aad62b0d24fe9..48dfeb3a1d1b2fa1fba132dd221e5bade3da1515 100644 (file)
@@ -1,6 +1,11 @@
 2019-08-30  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2019-03-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/82075
+       * g++.dg/cpp1z/decomp49.C: New test.
+
        2019-03-06  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/87148
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 ();
+}