blob: 3404a58f2258754a431ea0e2b9df2b58201d7e40 [file] [log] [blame]
// { dg-do compile { target c++17 } }
// { dg-options "-Wunused" }
#include <tuple>
struct A { int i,j,k; };
A f();
int p[3];
int z;
int main()
{
{
auto [i,j,k] = f(); // { dg-warning "unused" }
}
{
[[maybe_unused]] auto [i,j,k] = f();
}
{
auto [i,j,k] = f();
z = i;
}
{
auto [i,j,k] = f(); // { dg-warning "unused" }
i = 5;
}
{
auto [i,j] = std::tuple{1,2}; // { dg-warning "unused" }
}
{
[[maybe_unused]] auto [i,j] = std::tuple{1,2};
}
{
auto [i,j] = std::tuple{1,2};
z = i;
}
{
auto [i,j] = std::tuple{1,2};
i = 5;
}
{
auto [i,j,k] = p; // { dg-warning "unused" }
}
{
[[maybe_unused]] auto [i,j,k] = p;
}
{
auto [i,j,k] = p;
z = i;
}
{
auto [i,j,k] = p; // { dg-warning "unused" }
i = 5;
}
}