================ @@ -4210,6 +4215,7 @@ class Parser : public CodeCompletionHandler { /// \endverbatim ExprResult ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr, bool isTypeCast, + bool ParenKnownToBeNonCast, ---------------- Sirraide wrote:
> So it doesn't mean "this is, is not, or maybe a cast expression", it means > "if there's a typo, should we allow type names or not?" Ok, I like to say I’m bad at naming, but that is actually awful. ;Þ > How about this for a solution: > > 1. Rename `TypeCastState` to `TypoCorrectionTypeBehavior` > 2. Rename `NotTypeCast`, `IsTypeCast`, and `MaybeTypeCast` to `AllowNonTypes, > `AllowTypes`, and `AllowBoth` > 3. Add a new enumeration `TypeCastState` with members `IsTypeCast`, > `IsNotTypeCast`, and `Unknown` > 4. Change `ParseParenExpression` to take both a `TypoCorrectionTypeBehavior` > and a `TypeCastState`. I was about to suggest this so sgtm 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