aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-08-17 23:50:37 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-08-17 23:50:37 +0000
commit46877cd012c6637a9c98d5f27afbc3cbf73e57d0 (patch)
tree3f2907d4c135b56d26245701d806cee03f09a314 /lib/Parse/ParseDecl.cpp
parent4af473cf713522ed9511506685fb569a7f8b1764 (diff)
Get rid of extra nesting when checking for invalid type,
per Doug's comment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111328 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index ce0377020a..928c2a9b51 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -2726,13 +2726,13 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
// scope when parsing the parenthesized declarator, then exited
// the scope already. Re-enter the scope, if we need to.
if (D.getCXXScopeSpec().isSet()) {
- if (Actions.ShouldEnterDeclaratorScope(getCurScope(), D.getCXXScopeSpec()))
+ // If there was an error parsing parenthesized declarator, declarator
+ // scope may have been enterred before. Don't do it again.
+ if (!D.isInvalidType() &&
+ Actions.ShouldEnterDeclaratorScope(getCurScope(), D.getCXXScopeSpec()))
// Change the declaration context for name lookup, until this function
// is exited (and the declarator has been parsed).
- // 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();
+ DeclScopeObj.EnterDeclaratorScope();
}
} else if (D.mayOmitIdentifier()) {
// This could be something simple like "int" (in which case the declarator