diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-06 05:48:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-06 05:48:00 +0000 |
commit | 27591ff4fc64600fd67c5d81899e3efe5ef41a80 (patch) | |
tree | 857bb16b8d5583614378e21e113b043ea5720b8e /lib/Parse/ParseExprCXX.cpp | |
parent | 35de813674503b87ec5117b6492cc0a4ef7d8728 (diff) |
Improve recovery when we fail to parse the operand of a C++ named cast. Fixes PR5210
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExprCXX.cpp')
-rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index a00dfb0b4c..fa8e64dc12 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -381,13 +381,7 @@ Parser::OwningExprResult Parser::ParseCXXCasts() { OwningExprResult Result = ParseExpression(); // Match the ')'. - if (Result.isInvalid()) - SkipUntil(tok::r_paren); - - if (Tok.is(tok::r_paren)) - RParenLoc = ConsumeParen(); - else - MatchRHSPunctuation(tok::r_paren, LParenLoc); + RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc); if (!Result.isInvalid() && !CastTy.isInvalid()) Result = Actions.ActOnCXXNamedCast(OpLoc, Kind, |