[cfe-commits] r111328 - /cfe/trunk/lib/Parse/ParseDecl.cpp
Fariborz Jahanian
fjahanian at apple.com
Tue Aug 17 16:50:37 PDT 2010
Author: fjahanian
Date: Tue Aug 17 18:50:37 2010
New Revision: 111328
URL: http://llvm.org/viewvc/llvm-project?rev=111328&view=rev
Log:
Get rid of extra nesting when checking for invalid type,
per Doug's comment.
Modified:
cfe/trunk/lib/Parse/ParseDecl.cpp
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=111328&r1=111327&r2=111328&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Tue Aug 17 18:50:37 2010
@@ -2726,13 +2726,13 @@
// 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
More information about the cfe-commits
mailing list