================ @@ -2850,7 +2870,8 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr, isFoldOperator(NextToken().getKind())) { ExprType = ParenParseOption::FoldExpr; return ParseFoldExpression(ExprResult(), T); - } else if (isTypeCast) { + } else if (CorrectionBehavior == TypoCorrectionTypeBehavior::AllowTypes) { + // FIXME: This should not be predicated on typo correction behavior. ---------------- AaronBallman wrote:
This is worth noting! This was an unfortunate surprise. However, it's a preexisting defect that I don't have the bandwidth to correct right now. The old `TypeCastState` enumeration was introduced to help with typo correction (https://github.com/llvm/llvm-project/commit/77e21fca3cd1a9db882ac13ac5ddef3f278dfff2) and we accidentally ended up using it for parsing decisions: https://github.com/llvm/llvm-project/blob/a63f57262898588b576d66e5fd79c0aa64b35f2d/clang/lib/Parse/ParseExpr.cpp#L761 https://github.com/llvm/llvm-project/pull/146394 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits