[clang] [Clang][P1061] Add stuctured binding packs (PR #121417)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 1 01:33:29 PST 2025


================
@@ -7331,18 +7332,33 @@ void Parser::ParseDecompositionDeclarator(Declarator &D) {
           Diag(Tok, diag::err_expected_comma_or_rsquare);
         }
 
-        SkipUntil(tok::r_square, tok::comma, tok::identifier,
-                  StopAtSemi | StopBeforeMatch);
+        // I don't know why this skipping was here
+        // SkipUntil(tok::r_square, tok::comma, tok::identifier,
+        //          StopAtSemi | StopBeforeMatch);
         if (Tok.is(tok::comma))
           ConsumeToken();
-        else if (Tok.isNot(tok::identifier))
+        else if (Tok.is(tok::r_square))
           break;
       }
     }
 
     if (isCXX11AttributeSpecifier())
       DiagnoseAndSkipCXX11Attributes();
 
+    SourceLocation EllipsisLoc = {};
+
+    if (Tok.is(tok::ellipsis)) {
+      if (!getLangOpts().CPlusPlus26)
+        Diag(Tok, diag::warn_cxx2c_binding_pack);
----------------
cor3ntin wrote:

We should have an extension warning in c++26 mode (search for `diag::ext_cxx` for examples)

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


More information about the cfe-commits mailing list