@@ -4633,8 +4633,8 @@ class SubstNonTypeTemplateParmPackExpr : public Expr {
46334633 }
46344634};
46354635
4636- // / Represents a reference to a function parameter pack or init-capture pack
4637- // / that has been substituted but not yet expanded.
4636+ // / Represents a reference to a function parameter pack, init-capture pack,
4637+ // / or binding pack that has been substituted but not yet expanded.
46384638// /
46394639// / When a pack expansion contains multiple parameter packs at different levels,
46404640// / this node is used to represent a function parameter pack at an outer level
@@ -4649,49 +4649,48 @@ class SubstNonTypeTemplateParmPackExpr : public Expr {
46494649// / \endcode
46504650class FunctionParmPackExpr final
46514651 : public Expr,
4652- private llvm::TrailingObjects<FunctionParmPackExpr, VarDecl *> {
4652+ private llvm::TrailingObjects<FunctionParmPackExpr, ValueDecl *> {
46534653 friend class ASTReader ;
46544654 friend class ASTStmtReader ;
46554655 friend TrailingObjects;
46564656
46574657 // / The function parameter pack which was referenced.
4658- VarDecl *ParamPack;
4658+ ValueDecl *ParamPack;
46594659
46604660 // / The location of the function parameter pack reference.
46614661 SourceLocation NameLoc;
46624662
46634663 // / The number of expansions of this pack.
46644664 unsigned NumParameters;
46654665
4666- FunctionParmPackExpr (QualType T, VarDecl *ParamPack,
4667- SourceLocation NameLoc, unsigned NumParams,
4668- VarDecl *const *Params);
4666+ FunctionParmPackExpr (QualType T, ValueDecl *ParamPack, SourceLocation NameLoc,
4667+ unsigned NumParams, ValueDecl *const *Params);
46694668
46704669public:
46714670 static FunctionParmPackExpr *Create (const ASTContext &Context, QualType T,
4672- VarDecl *ParamPack,
4671+ ValueDecl *ParamPack,
46734672 SourceLocation NameLoc,
4674- ArrayRef<VarDecl *> Params);
4673+ ArrayRef<ValueDecl *> Params);
46754674 static FunctionParmPackExpr *CreateEmpty (const ASTContext &Context,
46764675 unsigned NumParams);
46774676
46784677 // / Get the parameter pack which this expression refers to.
4679- VarDecl *getParameterPack () const { return ParamPack; }
4678+ ValueDecl *getParameterPack () const { return ParamPack; }
46804679
46814680 // / Get the location of the parameter pack.
46824681 SourceLocation getParameterPackLocation () const { return NameLoc; }
46834682
46844683 // / Iterators over the parameters which the parameter pack expanded
46854684 // / into.
4686- using iterator = VarDecl * const *;
4687- iterator begin () const { return getTrailingObjects<VarDecl *>(); }
4685+ using iterator = ValueDecl * const *;
4686+ iterator begin () const { return getTrailingObjects<ValueDecl *>(); }
46884687 iterator end () const { return begin () + NumParameters; }
46894688
46904689 // / Get the number of parameters in this parameter pack.
46914690 unsigned getNumExpansions () const { return NumParameters; }
46924691
46934692 // / Get an expansion of the parameter pack by index.
4694- VarDecl *getExpansion (unsigned I) const { return begin ()[I]; }
4693+ ValueDecl *getExpansion (unsigned I) const { return begin ()[I]; }
46954694
46964695 SourceLocation getBeginLoc () const LLVM_READONLY { return NameLoc; }
46974696 SourceLocation getEndLoc () const LLVM_READONLY { return NameLoc; }
@@ -5319,59 +5318,6 @@ class BuiltinBitCastExpr final
53195318 }
53205319};
53215320
5322- // Represents an unexpanded pack where the list of expressions are
5323- // known. These are used when structured bindings introduce a pack.
5324- class ResolvedUnexpandedPackExpr final
5325- : public Expr,
5326- private llvm::TrailingObjects<ResolvedUnexpandedPackExpr, Expr *> {
5327- friend class ASTStmtReader ;
5328- friend class ASTStmtWriter ;
5329- friend TrailingObjects;
5330-
5331- SourceLocation BeginLoc;
5332- unsigned NumExprs;
5333-
5334- ResolvedUnexpandedPackExpr (SourceLocation BL, QualType QT, unsigned NumExprs);
5335-
5336- public:
5337- static ResolvedUnexpandedPackExpr *CreateDeserialized (ASTContext &C,
5338- unsigned NumExprs);
5339- static ResolvedUnexpandedPackExpr *
5340- Create (ASTContext &C, SourceLocation BeginLoc, QualType T, unsigned NumExprs);
5341- static ResolvedUnexpandedPackExpr *Create (ASTContext &C,
5342- SourceLocation BeginLoc, QualType T,
5343- llvm::ArrayRef<Expr *> Exprs);
5344-
5345- unsigned getNumExprs () const { return NumExprs; }
5346-
5347- llvm::MutableArrayRef<Expr *> getExprs () {
5348- return {getTrailingObjects<Expr *>(), NumExprs};
5349- }
5350-
5351- llvm::ArrayRef<Expr *> getExprs () const {
5352- return {getTrailingObjects<Expr *>(), NumExprs};
5353- }
5354-
5355- Expr *getExpansion (unsigned Idx) { return getExprs ()[Idx]; }
5356- Expr *getExpansion (unsigned Idx) const { return getExprs ()[Idx]; }
5357-
5358- // Iterators
5359- child_range children () {
5360- return child_range ((Stmt **)getTrailingObjects<Expr *>(),
5361- (Stmt **)getTrailingObjects<Expr *>() + getNumExprs ());
5362- }
5363-
5364- SourceLocation getBeginLoc () const LLVM_READONLY { return BeginLoc; }
5365- SourceLocation getEndLoc () const LLVM_READONLY { return BeginLoc; }
5366-
5367- // Returns the resolved pack of a decl or nullptr
5368- static ResolvedUnexpandedPackExpr *getFromDecl (Decl *);
5369-
5370- static bool classof (const Stmt *T) {
5371- return T->getStmtClass () == ResolvedUnexpandedPackExprClass;
5372- }
5373- };
5374-
53755321} // namespace clang
53765322
53775323#endif // LLVM_CLANG_AST_EXPRCXX_H
0 commit comments