[clang] [Sema] Avoid an undesired pack expansion while transforming PackIndexingType (PR #90195)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 30 03:55:59 PDT 2024
================
@@ -216,8 +216,14 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
return ClassifyInternal(Ctx,
cast<SubstNonTypeTemplateParmExpr>(E)->getReplacement());
- case Expr::PackIndexingExprClass:
+ case Expr::PackIndexingExprClass: {
+ // A dependent pack-index-expression is now supposed to denote a function
+ // parameter pack, an NTTP pack, or the pack introduced by a structured
+ // binding. Consider it as an LValue expression.
+ if (cast<PackIndexingExpr>(E)->isInstantiationDependent())
+ return Cl::CL_LValue;
----------------
cor3ntin wrote:
```suggestion
case Expr::PackIndexingExprClass: {
// A pack-index-expression always expand to an id-expression.
Consider it as an LValue expression.
if (cast<PackIndexingExpr>(E)->isInstantiationDependent())
return Cl::CL_LValue;
```
https://github.com/llvm/llvm-project/pull/90195
More information about the cfe-commits
mailing list