From 6fbaad21546a628edfc44ba6b2db419504d16203 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 8 Mar 2019 19:31:27 +0100 Subject: [PATCH] re PR c++/82075 (structured binding fails with empty base class) PR c++/82075 * g++.dg/cpp1z/decomp49.C: New test. From-SVN: r269504 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp1z/decomp49.C | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1z/decomp49.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 13b91c7965c..baa3126e6ad 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-08 Jakub Jelinek + + PR c++/82075 + * g++.dg/cpp1z/decomp49.C: New test. + 2019-03-08 Andre Vieira * 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 index 00000000000..525eb45af51 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp49.C @@ -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 (); +} -- 2.30.2