[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

Shahid Iqbal via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 27 02:03:24 PST 2024


================
@@ -2698,9 +2698,16 @@ StmtResult Parser::ParseCXXCatchBlock(bool FnCatch) {
     Declarator ExDecl(DS, Attributes, DeclaratorContext::CXXCatch);
     ParseDeclarator(ExDecl);
     ExceptionDecl = Actions.ActOnExceptionDeclarator(getCurScope(), ExDecl);
-  } else
-    ConsumeToken();
-
+  }
+  else {
+  CatchLoc = ConsumeToken();
+  // explicitly creating a var of type no-type for '...' and marking it as catch_all
+  ParsedAttributes Attributes(AttrFactory);
+  DeclSpec DS(AttrFactory);
+  Declarator ExDecl(DS, Attributes, DeclaratorContext::BlockLiteral);
+  ParseDeclarator(ExDecl);
+  ExceptionDecl = Actions.ActOnExceptionDeclarator(getCurScope(), ExDecl, true);
+  }
----------------
shahidiqbal13 wrote:

Hi @ChuanqiXu9 , Thanks for the review!
I think it won't be possible since if you see the ActOnExceptionDeclarator , we are not passing the Decl*, later we are updating the Decl*

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


More information about the cfe-commits mailing list