From 6df5fef6371d8cc02bb9466fca906a5842926556 Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 19 Dec 2009 10:49:29 +0000 Subject: Refactor to remove more dependencies on PreDeclaratorDC. I seem to have made the redeclaration problems in the [temp.explicit]p3 testcase worse, but I can live with that; they'll need to be fixed more holistically anyhow. llvm-svn: 91771 --- clang/lib/Parse/ParseCXXInlineMethods.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'clang/lib/Parse/ParseCXXInlineMethods.cpp') diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp index b9314d24244..f1e639c2957 100644 --- a/clang/lib/Parse/ParseCXXInlineMethods.cpp +++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp @@ -95,9 +95,12 @@ void Parser::ParseLexedMethodDeclarations(ParsingClass &Class) { if (HasTemplateScope) Actions.ActOnReenterTemplateScope(CurScope, Class.TagOrTemplate); + // The current scope is still active if we're the top-level class. + // Otherwise we'll need to push and enter a new scope. bool HasClassScope = !Class.TopLevelClass; - ParseScope ClassScope(this, Scope::ClassScope|Scope::DeclScope, - HasClassScope); + ParseScope ClassScope(this, Scope::ClassScope|Scope::DeclScope, HasClassScope); + if (HasClassScope) + Actions.ActOnStartDelayedMemberDeclarations(CurScope, Class.TagOrTemplate); for (; !Class.MethodDecls.empty(); Class.MethodDecls.pop_front()) { LateParsedMethodDeclaration &LM = Class.MethodDecls.front(); @@ -148,6 +151,9 @@ void Parser::ParseLexedMethodDeclarations(ParsingClass &Class) { for (unsigned I = 0, N = Class.NestedClasses.size(); I != N; ++I) ParseLexedMethodDeclarations(*Class.NestedClasses[I]); + + if (HasClassScope) + Actions.ActOnFinishDelayedMemberDeclarations(CurScope, Class.TagOrTemplate); } /// ParseLexedMethodDefs - We finished parsing the member specification of a top -- cgit v1.2.3