================
@@ -482,6 +526,57 @@ class DeducedTemplateStorage : public 
UncommonTemplateNameStorage,
                       TemplateName Underlying, const DefaultArguments 
&DefArgs);
 };
 
+/// A structure for storing a pack-index-template-name ([temp.names]).
+///
+/// C++29 [temp.names]p1:
+///   pack-index-template-name:
+///     simple-template-name ... [ constant-expression ]
+class PackIndexingTemplateStorage final
+    : public UncommonTemplateNameStorage,
+      public llvm::FoldingSetNode,
+      private llvm::TrailingObjects<PackIndexingTemplateStorage, TemplateName> 
{
+  friend class ASTContext;
+  friend TrailingObjects;
+
+  TemplateName Pattern;
+  llvm::PointerIntPair<Expr *, 1> IndexAndIsFullySubstitited;
+
+  PackIndexingTemplateStorage(TemplateName Pattern, Expr *IndexExpr,
+                              bool FullySubstituted,
+                              ArrayRef<TemplateName> Expansions);
+
+public:
+  TemplateName getPattern() const { return Pattern; }
+
+  Expr *getIndexExpr() const { return IndexAndIsFullySubstitited.getPointer(); 
}
+
+  bool isFullySubstituted() const {
+    return IndexAndIsFullySubstitited.getInt();
+  }
+
+  ArrayRef<TemplateName> getExpansions() const {
+    return getTrailingObjects(Bits.Data);
----------------
cor3ntin wrote:

I was considering adding a `getExpansionsCount` function to abstract that. But 
it would have no other uses so I decided not to. You think it would help?

(Data sort if makes sense given it's just some bytes usable by all ucommon 
template names)

https://github.com/llvm/llvm-project/pull/218738
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to