summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-07-15 00:11:48 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-07-15 00:11:48 +0000
commit5a477c5e372bde1f96c1146b5a68f02c7e93f40b (patch)
treed82f60b1b07b76462b5f543314d8178ec9dc2950 /clang/lib/Parse/ParseExpr.cpp
parentee54aaef0c87a55f75320dc9def39eaa2c267f64 (diff)
downloadbcm5719-llvm-5a477c5e372bde1f96c1146b5a68f02c7e93f40b.tar.gz
bcm5719-llvm-5a477c5e372bde1f96c1146b5a68f02c7e93f40b.zip
PR19751: (T())++ is not a cast-expression.
llvm-svn: 213022
Diffstat (limited to 'clang/lib/Parse/ParseExpr.cpp')
-rw-r--r--clang/lib/Parse/ParseExpr.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index 4a1742c2c08..0e4dfb91ad5 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -863,7 +863,12 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
// ++ cast-expression
// -- cast-expression
SourceLocation SavedLoc = ConsumeToken();
- Res = ParseCastExpression(!getLangOpts().CPlusPlus);
+ // One special case is implicitly handled here: if the preceding tokens are
+ // an ambiguous cast expression, such as "(T())++", then we recurse to
+ // determine whether the '++' is prefix or postfix.
+ Res = ParseCastExpression(!getLangOpts().CPlusPlus,
+ /*isAddressOfOperand*/false, NotCastExpr,
+ NotTypeCast);
if (!Res.isInvalid())
Res = Actions.ActOnUnaryOp(getCurScope(), SavedLoc, SavedKind, Res.get());
return Res;
OpenPOWER on IntegriCloud