Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(959)

Unified Diff: lib/Parse/ParseDecl.cpp

Issue 4978056: Added support for scoping of function parameters in late-parsed attributes (2)
Patch Set: Created 13 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/clang/Sema/Sema.h ('k') | lib/Sema/SemaDecl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Parse/ParseDecl.cpp
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 58593691148a47621c6ba913c189bea443daa2fe..f8408b8dc8b443335b4a86e8ca190ab1a6fd1aff 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -759,8 +759,18 @@ void Parser::ParseLexedAttribute(LateParsedAttribute &LA) {
ParsedAttributes Attrs(AttrFactory);
SourceLocation endLoc;
+ // For function attributes, enter the function scope
+ bool IsFunScope = Actions.IsFunction(LA.D);
+ ParseScope FnScope(this, Scope::FnScope | Scope::DeclScope, IsFunScope);
+ if (IsFunScope) Actions.EnterFunctionContext(LA.D);
+
ParseGNUAttributeArgs(&LA.AttrName, LA.AttrNameLoc, Attrs, &endLoc);
+ if (IsFunScope) {
+ Actions.ExitFunctionContext();
+ FnScope.Exit(); // Pop scope, and remove Decls from IdResolver
+ }
+
// Late parsed attributes must be attached to Decls by hand. If the
// LA.D is not set, then this was not done properly.
assert(LA.D && "No decl attached to late parsed attribute");
« no previous file with comments | « include/clang/Sema/Sema.h ('k') | lib/Sema/SemaDecl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b