summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Parse/ParseExprCXX.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index 5e6ba680679..681c6adb2ea 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -1088,12 +1088,17 @@ Parser::ParseCXXAmbiguousParenExpression(ParenParseOption &ExprType,
ParseAs = CompoundLiteral;
} else {
bool NotCastExpr;
- // Try parsing the cast-expression that may follow.
- // If it is not a cast-expression, NotCastExpr will be true and no token
- // will be consumed.
- Result = ParseCastExpression(false/*isUnaryExpression*/,
- false/*isAddressofOperand*/,
- NotCastExpr);
+ // FIXME: Special-case ++ and --: "(S())++;" is not a cast-expression
+ if (Tok.is(tok::l_paren) && NextToken().is(tok::r_paren)) {
+ NotCastExpr = true;
+ } else {
+ // Try parsing the cast-expression that may follow.
+ // If it is not a cast-expression, NotCastExpr will be true and no token
+ // will be consumed.
+ Result = ParseCastExpression(false/*isUnaryExpression*/,
+ false/*isAddressofOperand*/,
+ NotCastExpr);
+ }
// If we parsed a cast-expression, it's really a type-id, otherwise it's
// an expression.
OpenPOWER on IntegriCloud