https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85952
Bug ID: 85952 Summary: Bogus -Wunused-but-set-variable warning with array structured binding Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- int foo () { int a[2] = {1, 2}; // { dg-bogus "set but not used" } */ auto [x, y] = a; return x + y; } should not warn, but we handle the array temporary initialization from another array for structured bindings quite specially.