rsmith added a comment. Thanks, I like this approach a lot more.
================ Comment at: include/clang/Parse/Parser.h:1658 + CastExpr, // Also allow '(' type-name ')' <anything> + FoldExpr // Also allow fold-expression <anything> }; ---------------- This should be reordered up nearer the top (probably as the second enumerator); when we call `ParseParenExpression` with `ExprType == CastExpr` or `ExprType == CompoundLiteral`, we still want to parse `FoldExpr`s. ================ Comment at: lib/Parse/ParseExpr.cpp:2519-2563 } else if (Tok.is(tok::ellipsis) && isFoldOperator(NextToken().getKind())) { + ExprType = FoldExpr; return ParseFoldExpression(ExprResult(), T); } else if (isTypeCast) { // Parse the expression-list. InMessageExpressionRAIIObject InMessage(*this, false); ---------------- The cases where we parse a fold-expression should all be guarded by `ExprType >= FoldExpr`. Repository: rC Clang https://reviews.llvm.org/D49848 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits