diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-05 19:56:22 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-05 19:56:22 +0000 |
commit | 78c8d80f19cb0bccd4f3d590e71a230e727cfab5 (patch) | |
tree | 33e90db48d74ecb686e1f5c93e4a970c9354e149 /lib/Parse/ParseExpr.cpp | |
parent | 9b533164570a67c81ad49f3691f02608530a042e (diff) |
Handle ambiguities between expressions and type-ids that occur inside parentheses, e.g.:
sizeof(int()) -> "int()" is type-id
sizeof(int()+1) -> "int()+1" is expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57131 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 64f31ddbc8..c8d95cf053 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -981,7 +981,7 @@ Parser::ExprResult Parser::ParseParenExpression(ParenParseOption &ExprType, if (!Stmt.isInvalid && Tok.is(tok::r_paren)) Result = Actions.ActOnStmtExpr(OpenLoc, Stmt.Val, Tok.getLocation()); - } else if (ExprType >= CompoundLiteral && isTypeSpecifierQualifier()) { + } else if (ExprType >= CompoundLiteral && isTypeIdInParens()) { // Otherwise, this is a compound literal expression or cast expression. TypeTy *Ty = ParseTypeName(); |