From 055068df4a48e492ddcfd8ff7c47cd007ab15cb0 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 16 Aug 2010 17:58:53 +0000 Subject: Fix a crash when parsing malformed out-of-line member function definition. radar 8307865. llvm-svn: 111163 --- clang/lib/Parse/ParseDecl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/lib/Parse/ParseDecl.cpp') diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index b0d9da58457..7149d4dc302 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/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 -- cgit v1.2.3