Index: lib/Parse/ParseExpr.cpp =================================================================== --- lib/Parse/ParseExpr.cpp +++ lib/Parse/ParseExpr.cpp @@ -270,7 +270,7 @@ return Level > prec::Unknown && Level != prec::Conditional; } static bool isFoldOperator(tok::TokenKind Kind) { - return isFoldOperator(getBinOpPrecedence(Kind, false, true)); + return isFoldOperator(getBinOpPrecedence(Kind, true, true)); } /// \brief Parse a binary expression that starts with \p LHS and has a Index: test/Parser/cxx1z-fold-expressions.cpp =================================================================== --- test/Parser/cxx1z-fold-expressions.cpp +++ test/Parser/cxx1z-fold-expressions.cpp @@ -43,3 +43,8 @@ (int)(undeclared_junk + ...) + // expected-error {{undeclared}} (int)(a + ...); // expected-error {{does not contain any unexpanded}} } + +// fold-operator can be '>' or '>>'. +template bool greater_than() { return (N > ...); } +template int right_shift() { return (N >> ...); } +