================
@@ -12726,11 +12726,15 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
// Likewise, variables with tuple-like bindings are required if their
// bindings have side-effects.
- if (const auto *DD = dyn_cast<DecompositionDecl>(VD))
- for (const auto *BD : DD->bindings())
- if (const auto *BindingVD = BD->getHoldingVar())
- if (DeclMustBeEmitted(BindingVD))
- return true;
+ if (const auto *DD = dyn_cast<DecompositionDecl>(VD)) {
+ bool BindingResult = false;
+ DD->VisitHoldingVars([&](VarDecl *BindingVD) {
----------------
ricejasonf wrote:
I just added a flat_binding_iterator to replace these Visit* functions. I
forgot to use it here, but if a custom iterator is what you wanted, please
consider it.
https://github.com/llvm/llvm-project/pull/121417
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits