This patch allows the parsing of a postfix expression involving a fold expression, which is legal as a fold-expression is a primary-expression.
See also https://llvm.org/pr38282
Differential D49848
Parse a possible trailing postfix expression suffix after a fold expression Rakete1111 on Jul 26 2018, 5:36 AM. Authored by
Details This patch allows the parsing of a postfix expression involving a fold expression, which is legal as a fold-expression is a primary-expression. See also https://llvm.org/pr38282
Diff Detail
Event TimelineComment Actions @rsmith you're right, it should. But it doesn't, because the the fold expression is considered to be a cast expression by ParseParenExpression and which parses any postfix pieces immediately after a cast, but it doesn't do so for fold expression, because they don't (not surprisingly) involve a cast. I've added a new type of ParenParseOption for fold-expressions for this, which makes the patch way more cleaner :) (I didn't want to reuse SimpleExpr for fold expressions - conflicts with the docs for it) Comment Actions Thanks, I like this approach a lot more.
|