diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-01-09 22:42:13 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-01-09 22:42:13 +0000 |
commit | 3218c4bb3b5d7250f12420de6db7ef3e3f805a75 (patch) | |
tree | f6826e25245398cff43f0546bbd58b338864fae2 /lib/Parse/Parser.cpp | |
parent | ef64fcfbfb99495d7f9f64c7f0751c2827028733 (diff) |
When we see a reference to a struct, class, or union like "struct X"
that is neither a definition nor a forward declaration and where X has
not yet been declared as a tag, introduce a declaration
into the appropriate scope (which is likely *not* to be the current
scope). The rules for the placement of the declaration differ slightly
in C and C++, so we implement both and test the various corner
cases. This implementation isn't 100% correct due to some lingering
issues with the function prototype scope (for a function parameter
list) not being the same scope as the scope of the function
definition. Testcase is FIXME'd; this probably isn't an important issue.
Addresses <rdar://problem/6484805>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62014 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r-- | lib/Parse/Parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index d9b39099e0..799a2072f1 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -570,7 +570,7 @@ void Parser::ParseKNRParamDeclarations(Declarator &D) { // Enter function-declaration scope, limiting any declarators to the // function prototype scope, including parameter declarators. - ParseScope PrototypeScope(this, Scope::FnScope|Scope::DeclScope); + ParseScope PrototypeScope(this, Scope::FunctionPrototypeScope|Scope::DeclScope); // Read all the argument declarations. while (isDeclarationSpecifier()) { |