================ @@ -102,11 +102,21 @@ namespace PR33839 { for (auto [x] : a) { // expected-warning {{unused variable '[x]'}} } } - void use() { + void use() { f<int>(); // expected-note {{instantiation of}} g<true>(); g<false>(); h<int>(); // expected-note {{instantiation of}} } } + +namespace maybe_unused_binding { + +void test() { + struct X { int a, b; } x; + auto [a [[maybe_unused]], b] = x; // expected-warning {{an attribute specifier sequence attached to a structured binding declaration is a C++2c extension}} ---------------- cor3ntin wrote:
This is that test. By marking one of the member unused, we don't warn on any of the member. This perhaps not perfect but the standard already specified that if one of the member is used, we should not warn on any of the biding https://github.com/llvm/llvm-project/pull/89906 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits