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 | 658b9550bb07d9f5ab24487c9c2e33cbddec36b4 (patch) | |
tree | 2ff99f3acebd6953a1e5988ddd72f81b4e1c92d9 /clang/lib/Parse/ParseCXXInlineMethods.cpp | |
parent | 60e734782f24b671d6c70e6b3744a3c0aaf9475a (diff) | |
download | bcm5719-llvm-658b9550bb07d9f5ab24487c9c2e33cbddec36b4.tar.gz bcm5719-llvm-658b9550bb07d9f5ab24487c9c2e33cbddec36b4.zip |
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>.
llvm-svn: 62014
Diffstat (limited to 'clang/lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r-- | clang/lib/Parse/ParseCXXInlineMethods.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp index a9712fe9ed4..90d2f6fefce 100644 --- a/clang/lib/Parse/ParseCXXInlineMethods.cpp +++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp @@ -75,7 +75,8 @@ void Parser::ParseLexedMethodDeclarations() { // Introduce the parameters into scope and parse their default // arguments. - ParseScope PrototypeScope(this, Scope::FnScope|Scope::DeclScope); + ParseScope PrototypeScope(this, + Scope::FunctionPrototypeScope|Scope::DeclScope); for (unsigned I = 0, N = LM.DefaultArgs.size(); I != N; ++I) { // Introduce the parameter into scope. Actions.ActOnDelayedCXXMethodParameter(CurScope, LM.DefaultArgs[I].Param); |