This problem seems to have been fixed in the compilers now. GCC 7.3 does
warn about the above code (with -Wall), but GCC 8.2 doesn't. However,
GCC 8.2 does warn about other unused variables - if you add a gratuitous
"int k = 42;" to the above (and never use k), you get a warning. The
same thing (no warning about unused structured binding, but a warning
about a "legitimate" unused variable) happens with Clang 5.0, MSVC 2017,
and Xcode 10. So I think we can safely conclude that the compiler
vendors have been aware of this issue for a while now, and it's no
longer a problem.
Ross Smith