================ @@ -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); + } ---------------- ChuanqiXu9 wrote:
I am hesitate on this. IIUC, previously the catch(...) format is reprensented as the exception decl as nullptr? Then if yes, we should be able to reuse that. https://github.com/llvm/llvm-project/pull/80976 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits