diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-08-16 17:58:53 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-08-16 17:58:53 +0000 |
commit | d6577428627bd4b7f8cd87e213151ebe6a587a9f (patch) | |
tree | 7f1eb2324017d2652a2639aed141777fc9a50aab /lib/Parse/ParseDecl.cpp | |
parent | 881b36ccbf8eaee709e7763369062a52f5961df1 (diff) |
Fix a crash when parsing malformed out-of-line member function
definition. radar 8307865.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111163 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index b0d9da5845..7149d4dc30 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2727,7 +2727,10 @@ void Parser::ParseDirectDeclarator(Declarator &D) { if (Actions.ShouldEnterDeclaratorScope(getCurScope(), D.getCXXScopeSpec())) // Change the declaration context for name lookup, until this function // is exited (and the declarator has been parsed). - DeclScopeObj.EnterDeclaratorScope(); + // If there was an error parsing parenthesized declarator, declarator + // scope may have been enterred before. Don't do it again. + if (!D.isInvalidType()) + DeclScopeObj.EnterDeclaratorScope(); } } else if (D.mayOmitIdentifier()) { // This could be something simple like "int" (in which case the declarator |