diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-08-16 19:34:46 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-08-16 19:34:46 +0000 |
commit | 289d77302aa81dc24bf7aa75b36cb00a70a44bb5 (patch) | |
tree | 57c389b0e3a229f560c447e2a7124bbc383b8f1b | |
parent | 5d796aa7899d37d7f243fbc738d6bb8108791fbe (diff) |
Move handling of postfix-expression suffixes out of ParseCXXThis and into ParseCastExpression.
No functionality change, this follows the convention of how postfix-expressions are handled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54849 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 4 | ||||
-rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 2ecca33cf5..c8856198fd 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -540,7 +540,9 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) { case tok::kw_static_cast: return ParseCXXCasts(); case tok::kw_this: - return ParseCXXThis(); + Res = ParseCXXThis(); + // This can be followed by postfix-expr pieces. + return ParsePostfixExpressionSuffix(Res); case tok::at: { SourceLocation AtLoc = ConsumeToken(); return ParseObjCAtExpression(AtLoc); diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index 93eaa2dedd..45f482792d 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -112,10 +112,5 @@ Parser::ExprResult Parser::ParseThrowExpression() { Parser::ExprResult Parser::ParseCXXThis() { assert(Tok.is(tok::kw_this) && "Not 'this'!"); SourceLocation ThisLoc = ConsumeToken(); - - ExprResult Res = Actions.ActOnCXXThis(ThisLoc); - if (Res.isInvalid) - return Res; - - return ParsePostfixExpressionSuffix(Res); + return Actions.ActOnCXXThis(ThisLoc); } |