Reputation: 21707
: warning: unused variable ‘_y’ [-Wunused-variable]
[[maybe_unused]] const auto [x, _y] = f();
How do I prevent the warning here? [[maybe_unused]]
doesn't seem to work in this case?
Upvotes: 0
Views: 197
Reputation: 21707
As suggested by comments, -Wunused-variable
only appears in gcc7
[[maybe_unused]]
is not needed for newer gcc
Upvotes: 1