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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 9 10:21:21 PST 2024


================
@@ -1067,6 +1067,17 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
       // where the syntax forbids a type.
       const Token &Next = NextToken();
 
+      if (getLangOpts().CPlusPlus26 && Next.is(tok::ellipsis) &&
----------------
erichkeane wrote:

Same suggestion here as above, it would be REALLY nice to just error 'not supported pre-26', then actually parse the rest anyway.  The diagnostic you'd get for this in earlier modes is awkward and not really clear, so since we know it means something now, actually treating it as an error + parsing the rest probably gives a much better experience.

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


More information about the cfe-commits mailing list