[clang] [clang-format] Fix a bug in parsing C-style cast lambda (PR #136099)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 18 08:24:25 PDT 2025
================
@@ -2371,7 +2371,8 @@ bool UnwrappedLineParser::tryToParseLambdaIntroducer() {
if ((Previous && ((Previous->Tok.getIdentifierInfo() &&
!Previous->isOneOf(tok::kw_return, tok::kw_co_await,
tok::kw_co_yield, tok::kw_co_return)) ||
- Previous->closesScope())) ||
+ (Previous->closesScope() &&
+ !Previous->endsSequence(tok::r_paren, tok::greater)))) ||
----------------
HazardyKnusperkeks wrote:
And if it is casted to `int(*)`?
I know we didn't annotate stuff here, it is hard to detect if this is a cast, but is there maybe a different way which would be a bit more resilient?
https://github.com/llvm/llvm-project/pull/136099
More information about the cfe-commits
mailing list