[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

Louis Dionne via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 10 07:54:57 PST 2024


================
@@ -978,6 +978,20 @@ bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) {
       } else {
         break;
       }
+      // Pack indexing
+      if (getLangOpts().CPlusPlus26 && Tok.is(tok::ellipsis) &&
----------------
ldionne wrote:

@philnik777 This would require GCC to also support that as an extension in C++11 (and above). Otherwise we wouldn't be able to use it in our tuple implementation. If we had such an extension, I suspect compilation times for any tuple-heavy code would go down quite a bit. In fact the most interesting part is that we might be able to simplify how we store elements inside the tuple -- right now we have to use some kind of base class trick because that's how we manage to perform indexing afterwards, but that's expensive.

https://github.com/llvm/llvm-project/pull/72644


More information about the cfe-commits mailing list