[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 12 11:10:27 PST 2024
================
@@ -1665,6 +1665,43 @@ NonTypeTemplateParmDecl *SubstNonTypeTemplateParmExpr::getParameter() const {
getReplacedTemplateParameterList(getAssociatedDecl())->asArray()[Index]);
}
+PackIndexingExpr *PackIndexingExpr::Create(ASTContext &Context,
+ SourceLocation EllipsisLoc,
+ SourceLocation RSquareLoc,
+ Expr *PackIdExpr, Expr *IndexExpr,
+ std::optional<int64_t> Index,
+ ArrayRef<Expr *> SubstitutedExprs) {
+ QualType Type;
+ if (Index && !SubstitutedExprs.empty())
----------------
erichkeane wrote:
We probably want to just do `if (Index)` then `assert(!SubstitutedExprs.empty())` is what I meant here.
https://github.com/llvm/llvm-project/pull/72644
More information about the cfe-commits
mailing list