[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-29 Thread Jason Rice via cfe-commits
ricejasonf wrote: >@ricejasonf let us know if you want us to merge on your behalf @cor3ntin When you think its ready, yes please. I think it requires write access. I fixed the conflict in the ReleaseNotes through Github's UI so that only my feature is under the C++2c features added. I assume o

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-29 Thread Jason Rice via cfe-commits
ricejasonf wrote: @cor3ntin > Now that the Clang 20 branch has happened, I think we should go ahead with > that PR Does this mean we should adjust the cxx_status page to not say Clang 20? I also see there is a conflict with the ReleaseNotes.md where it appears all of the C++2c items no long

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-28 Thread Jason Rice via cfe-commits
@@ -4213,8 +4226,35 @@ class DecompositionDecl final static DecompositionDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned NumBindings); - ArrayRef bindings() const { -return llvm::ArrayRef(getTrailingObject

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-27 Thread Jason Rice via cfe-commits
@@ -1523,9 +1570,25 @@ void Sema::CheckCompleteDecompositionDeclaration(DecompositionDecl *DD) { // If the type of the decomposition is dependent, then so is the type of // each binding. if (DecompType->isDependentType()) { -for (auto *B : DD->bindings()) - B->s

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-27 Thread Jason Rice via cfe-commits
@@ -3423,6 +3425,13 @@ VarDecl *BindingDecl::getHoldingVar() const { return VD; } +llvm::ArrayRef BindingDecl::getBindingPackExprs() const { + if (!Binding) +return {}; ricejasonf wrote: Added. The assert was being triggered in one spot that I realized

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-26 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf edited https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-26 Thread Jason Rice via cfe-commits
@@ -1523,9 +1570,25 @@ void Sema::CheckCompleteDecompositionDeclaration(DecompositionDecl *DD) { // If the type of the decomposition is dependent, then so is the type of // each binding. if (DecompType->isDependentType()) { -for (auto *B : DD->bindings()) - B->s

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-25 Thread Jason Rice via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++26 %s -verify ricejasonf wrote: I added these to the bottom of this file. https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-co

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-23 Thread Jason Rice via cfe-commits
ricejasonf wrote: > I wonder if we should rename flat_bindings() to bindings() and bindings() to > bindings_as_written() (or similar), as I expect that to be the function we > ~always want to use. I do not have a strong preference, but I kept `bindings()` the same since it represents the stru

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-22 Thread Jason Rice via cfe-commits
@@ -5321,6 +5321,59 @@ class BuiltinBitCastExpr final } }; +// Represents an unexpanded pack where the list of expressions are +// known. These are used when structured bindings introduce a pack. +class ResolvedUnexpandedPackExpr final +: public Expr, + private llvm

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-21 Thread Jason Rice via cfe-commits
@@ -5321,6 +5321,59 @@ class BuiltinBitCastExpr final } }; +// Represents an unexpanded pack where the list of expressions are +// known. These are used when structured bindings introduce a pack. +class ResolvedUnexpandedPackExpr final +: public Expr, + private llvm

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-20 Thread Jason Rice via cfe-commits
@@ -951,28 +959,124 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return New; } +// CheckBindingsCount +// - Checks the arity of the structured bindings +// - Creates the resolved pack expr if there is +//one +static bool CheckBindingsCount(Sema &S, D

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-18 Thread Jason Rice via cfe-commits
@@ -951,28 +959,124 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return New; } +// CheckBindingsCount +// - Checks the arity of the structured bindings +// - Creates the resolved pack expr if there is +//one +static bool CheckBindingsCount(Sema &S, D

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-18 Thread Jason Rice via cfe-commits
@@ -1099,6 +1099,13 @@ def err_lambda_capture_misplaced_ellipsis : Error< "the name of the capture">; def err_lambda_capture_multiple_ellipses : Error< "multiple ellipses in pack capture">; +def err_binding_multiple_ellipses : Error< + "multiple packs in structured binding

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-18 Thread Jason Rice via cfe-commits
@@ -951,28 +959,124 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return New; } +// CheckBindingsCount +// - Checks the arity of the structured bindings +// - Creates the resolved pack expr if there is +//one +static bool CheckBindingsCount(Sema &S, D

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf edited https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf edited https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf edited https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
@@ -951,28 +959,124 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return New; } +// CheckBindingsCount +// - Checks the arity of the structured bindings +// - Creates the resolved pack expr if there is +//one +static bool CheckBindingsCount(Sema &S, D

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
@@ -951,28 +959,124 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return New; } +// CheckBindingsCount +// - Checks the arity of the structured bindings +// - Creates the resolved pack expr if there is +//one +static bool CheckBindingsCount(Sema &S, D

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
@@ -5321,6 +5321,59 @@ class BuiltinBitCastExpr final } }; +// Represents an unexpanded pack where the list of expressions are +// known. These are used when structured bindings introduce a pack. +class ResolvedUnexpandedPackExpr final ricejasonf wrote: I d

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
@@ -757,23 +775,40 @@ bool Sema::CheckParameterPacksForExpansion( bool HaveFirstPack = false; std::optional NumPartialExpansions; SourceLocation PartiallySubstitutedPackLoc; + typedef LocalInstantiationScope::DeclArgumentPack DeclArgumentPack; for (UnexpandedParamet

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
@@ -15991,6 +15998,24 @@ TreeTransform::TransformFunctionParmPackExpr(FunctionParmPackExpr *E) { return E; } +template +ExprResult TreeTransform::TransformResolvedUnexpandedPackExpr( +ResolvedUnexpandedPackExpr *E) { + bool ArgumentChanged = false; + SmallVector NewE

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
@@ -50,17 +50,29 @@ class CollectUnexpandedParameterPacksVisitor auto *FTD = FD ? FD->getDescribedFunctionTemplate() : nullptr; if (FTD && FTD->getTemplateParameters()->getDepth() >= DepthLimit) return; - } else if (getDepthAndIndex(ND).first >= D

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
@@ -1166,26 +1166,54 @@ TemplateDeclInstantiator::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) { Decl *TemplateDeclInstantiator::VisitBindingDecl(BindingDecl *D) { auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(), -

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-17 Thread Jason Rice via cfe-commits
@@ -1166,26 +1166,54 @@ TemplateDeclInstantiator::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) { Decl *TemplateDeclInstantiator::VisitBindingDecl(BindingDecl *D) { auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(), -

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-15 Thread Jason Rice via cfe-commits
@@ -1508,23 +1612,52 @@ static bool checkMemberDecomposition(Sema &S, ArrayRef Bindings, Qualifiers Q = DecompType.getQualifiers(); if (FD->isMutable()) Q.removeConst(); -B->setBinding(S.BuildQualifiedType(FD->getType(), Loc, Q), E.get()); +Walker.commitA

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-15 Thread Jason Rice via cfe-commits
@@ -104,7 +104,6 @@ void CodeGenFunction::EmitDecl(const Decl &D) { case Decl::Binding: case Decl::UnresolvedUsingIfExists: case Decl::HLSLBuffer: -llvm_unreachable("Declaration should not be in declstmts!"); ricejasonf wrote: I will just put this ba

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-15 Thread Jason Rice via cfe-commits
@@ -237,7 +237,7 @@ bool Decl::isTemplateParameterPack() const { } bool Decl::isParameterPack() const { - if (const auto *Var = dyn_cast(this)) + if (const auto *Var = dyn_cast(this)) ricejasonf wrote: They would still both just look for a PackExpansionType

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-14 Thread Jason Rice via cfe-commits
ricejasonf wrote: @erichkeane, thanks for the approval. Does that mean I should stop making changes to this PR? I was messing with a more rangey interface for `flat_bindings`, but for some reason the `llvm::concat` range was referring to uninitialized memory when used as a temporary in a for l

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-10 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf edited https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-10 Thread Jason Rice via cfe-commits
@@ -1965,3 +1965,52 @@ CXXFoldExpr::CXXFoldExpr(QualType T, UnresolvedLookupExpr *Callee, SubExprs[SubExpr::RHS] = RHS; setDependence(computeDependence(this)); } + +ResolvedUnexpandedPackExpr::ResolvedUnexpandedPackExpr(SourceLocation BL, +

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-10 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf edited https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-10 Thread Jason Rice via cfe-commits
@@ -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(VD)) -for (const auto *BD : DD->bindings()) - if (co

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-09 Thread Jason Rice via cfe-commits
@@ -2202,6 +2202,17 @@ void ASTStmtWriter::VisitPackIndexingExpr(PackIndexingExpr *E) { Code = serialization::EXPR_PACK_INDEXING; } +void ASTStmtWriter::VisitResolvedUnexpandedPackExpr( ricejasonf wrote: Yes, and thank you for the heads up. I did add a tes

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-09 Thread Jason Rice via cfe-commits
@@ -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(VD)) -for (const auto *BD : DD->bindings()) - if (co

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-06 Thread Jason Rice via cfe-commits
@@ -951,28 +959,130 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return New; } +namespace { +// CheckBindingsCount +// - Checks the arity of the structured bindings +// - Creates the resolved pack expr if there is +//one +bool CheckBindingsCount(Sema

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf updated https://github.com/llvm/llvm-project/pull/121417 >From 3c81c5bd989f26331917f1401becc1cfa7f4a454 Mon Sep 17 00:00:00 2001 From: Jason Rice Date: Thu, 22 Jul 2021 16:46:33 -0700 Subject: [PATCH 1/6] [Clang][P1061] stuctured binding packs --- clang/include/c

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf edited https://github.com/llvm/llvm-project/pull/121417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
@@ -951,28 +959,130 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return New; } +namespace { +// CheckBindingsCount +// - Checks the arity of the structured bindings +// - Creates the resolved pack expr if there is +//one +bool CheckBindingsCount(Sema

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf updated https://github.com/llvm/llvm-project/pull/121417 >From 3c81c5bd989f26331917f1401becc1cfa7f4a454 Mon Sep 17 00:00:00 2001 From: Jason Rice Date: Thu, 22 Jul 2021 16:46:33 -0700 Subject: [PATCH 1/5] [Clang][P1061] stuctured binding packs --- clang/include/c

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
@@ -15991,6 +15991,13 @@ TreeTransform::TransformFunctionParmPackExpr(FunctionParmPackExpr *E) { return E; } +template +ExprResult TreeTransform::TransformResolvedUnexpandedPackExpr( +ResolvedUnexpandedPackExpr *E) { + // Default behavior is to do nothing with this tr

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf updated https://github.com/llvm/llvm-project/pull/121417 >From 3c81c5bd989f26331917f1401becc1cfa7f4a454 Mon Sep 17 00:00:00 2001 From: Jason Rice Date: Thu, 22 Jul 2021 16:46:33 -0700 Subject: [PATCH 1/4] [Clang][P1061] stuctured binding packs --- clang/include/c

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
@@ -805,7 +805,6 @@ Sema::InstantiatingTemplate::InstantiatingTemplate( SemaRef, CodeSynthesisContext::BuildingDeductionGuides, PointOfInstantiation, InstantiationRange, Entity) {} - ricejasonf wrote: Sorry, `git clang-format` keeps modify

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
@@ -422,8 +445,8 @@ Sema::DiagnoseUnexpandedParameterPacks(SourceLocation Loc, if (const TemplateTypeParmType *TTP = Unexpanded[I].first.dyn_cast()) Name = TTP->getIdentifier(); -else - Name = cast(Unexpanded[I].first)->getIdentifier(); +else if

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
@@ -422,8 +445,8 @@ Sema::DiagnoseUnexpandedParameterPacks(SourceLocation Loc, if (const TemplateTypeParmType *TTP = Unexpanded[I].first.dyn_cast()) Name = TTP->getIdentifier(); -else - Name = cast(Unexpanded[I].first)->getIdentifier(); +else if

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
@@ -50,16 +51,28 @@ class CollectUnexpandedParameterPacksVisitor auto *FTD = FD ? FD->getDescribedFunctionTemplate() : nullptr; if (FTD && FTD->getTemplateParameters()->getDepth() >= DepthLimit) return; - } else if (getDepthAndIndex(ND).first >= D

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-03 Thread Jason Rice via cfe-commits
@@ -951,28 +959,130 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return New; } +namespace { +// CheckBindingsCount +// - Checks the arity of the structured bindings +// - Creates the resolved pack expr if there is +//one +bool CheckBindingsCount(Sema

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Jason Rice via cfe-commits
ricejasonf wrote: That crash looks like a result of my call to setDecomposedDecl(nullptr) in the BindingsInitWalker stuff. I don't remember why I don't set that. I will check it out when I try to clean that up. > But that also makes it confusing as to this implementation - I suggest avoiding unr

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf updated https://github.com/llvm/llvm-project/pull/121417 >From 3c81c5bd989f26331917f1401becc1cfa7f4a454 Mon Sep 17 00:00:00 2001 From: Jason Rice Date: Thu, 22 Jul 2021 16:46:33 -0700 Subject: [PATCH 1/3] [Clang][P1061] stuctured binding packs --- clang/include/c

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Jason Rice via cfe-commits
@@ -928,9 +928,10 @@ static TemplateArgumentLoc translateTemplateArgument(Sema &SemaRef, void Sema::translateTemplateArguments(const ASTTemplateArgsPtr &TemplateArgsIn, TemplateArgumentListInfo &TemplateArgs) { - for (unsigned I = 0, Last

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Jason Rice via cfe-commits
@@ -755,7 +755,7 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) { return true; }; - const auto *CallerDecl = dyn_cast(CurContext); + const auto *CallerDecl = getCurFunctionDecl(); ricejasonf wrote: Stuff like this is from the implic

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Jason Rice via cfe-commits
@@ -1508,23 +1612,52 @@ static bool checkMemberDecomposition(Sema &S, ArrayRef Bindings, Qualifiers Q = DecompType.getQualifiers(); if (FD->isMutable()) Q.removeConst(); -B->setBinding(S.BuildQualifiedType(FD->getType(), Loc, Q), E.get()); +Walker.commitA

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Jason Rice via cfe-commits
@@ -951,28 +959,130 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return New; } +namespace { +// CheckBindingsCount +// - Checks the arity of the structured bindings +// - Creates the resolved pack expr if there is +//one +bool CheckBindingsCount(Sema

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Jason Rice via cfe-commits
@@ -0,0 +1,82 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++2b %s -verify +// expected-no-diagnostics + +template +struct type_ { }; + +template +auto sum(T... t) { return (t + ...); } + +struct my_struct { + int a; + int b; + int c; + int d; +}; + +struct fake

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-02 Thread Jason Rice via cfe-commits
@@ -422,8 +445,8 @@ Sema::DiagnoseUnexpandedParameterPacks(SourceLocation Loc, if (const TemplateTypeParmType *TTP = Unexpanded[I].first.dyn_cast()) Name = TTP->getIdentifier(); -else - Name = cast(Unexpanded[I].first)->getIdentifier(); +else if

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-01 Thread Jason Rice via cfe-commits
@@ -5397,6 +5393,13 @@ bool ValueDecl::isInitCapture() const { return false; } +bool ValueDecl::isParameterPack() const { + if (const auto *NTTP = dyn_cast(this)) +return NTTP->isParameterPack(); + + return isa_and_nonnull(getType().getTypePtrOrNull()); ---

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-01 Thread Jason Rice via cfe-commits
@@ -4219,6 +4220,13 @@ class DecompositionDecl final void printName(raw_ostream &OS, const PrintingPolicy &Policy) const override; + /// Visit the variables (if any) that hold the values of evaluating the + /// binding. Only present for user-defined bindings for tuple-lik

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2025-01-01 Thread Jason Rice via cfe-commits
@@ -3395,26 +3395,37 @@ VarDecl *ValueDecl::getPotentiallyDecomposedVarDecl() { if (auto *Var = llvm::dyn_cast(this)) return Var; if (auto *BD = llvm::dyn_cast(this)) -return llvm::dyn_cast(BD->getDecomposedDecl()); +return llvm::dyn_cast_or_null(BD->getDecompos

[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

2024-12-31 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf created https://github.com/llvm/llvm-project/pull/121417 This is an implementation of P1061 Structure Bindings Introduce a Pack without the ability to use packs outside of templates. There is a couple of ways the AST could have been sliced so let me know what you

[clang] [Clang][P1061] Fix template arguments in local classes (PR #121225)

2024-12-27 Thread Jason Rice via cfe-commits
https://github.com/ricejasonf created https://github.com/llvm/llvm-project/pull/121225 In the development of P1061 (Structured Bindings Introduce a Patch), I found this bug in the template instantiation of a local class. The issue is caused by the instantiation of the original template and not