[PATCH] D36101: Fix usage of right shift operator in fold expressions

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 30 13:41:31 PDT 2017


rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

Thanks!



================
Comment at: lib/Parse/ParseExpr.cpp:273
 static bool isFoldOperator(tok::TokenKind Kind) {
-  return isFoldOperator(getBinOpPrecedence(Kind, false, true));
+  return isFoldOperator(getBinOpPrecedence(Kind, true, true));
 }
----------------
Do we ever need to pass in the `Parser`'s `GreaterThanIsOperator` value here? (From a quick check, it looks like we never call `isFoldOperator` in any case where `>` might end a template argument list instead, but it's not completely obvious, because we do support parsing unparenthesized fold operators for better error handling in some cases.)

Seems like it would be safer to pass the correct value in here, even if it happens to not matter right now.


https://reviews.llvm.org/D36101





More information about the cfe-commits mailing list