================ @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2c -Wunused %s + +namespace GH125810 { +struct S { + int a, b; +}; + +void t(S s) { + auto &[_, _] = s; + auto &[a1, _] = s; // expected-warning {{unused variable '[a1, _]'}} ---------------- AaronBallman wrote:
> the entire binding declaration is used as the diagnostic location, including > all binding elements, even when only some of them are actually unused. Is > this the expected behavior? It's the current behavior but I think we could improve it. For example, it would be much better in this case to point to each binding declaration that's unused as opposed to the whole structured binding. But the behavior for now is okay. https://github.com/llvm/llvm-project/pull/127061 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits