diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-27 17:07:49 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-27 17:07:49 +0000 |
commit | 2bba76b0ec4c2f2134eebb1a2bbfe102f36c2f6e (patch) | |
tree | 611cf27603b2bde8b1b67ddd443eee3fffbd79c0 /lib/Parse/ParseDeclCXX.cpp | |
parent | e70e8f7fef3efb3d526ee25b3a0e2a4bf67a04b6 (diff) |
Improve name lookup for and template instantiation of declaration
references. There are several smallish fixes here:
- Make sure we look through template parameter scope when
determining whether we're parsing a nested class (or nested class
*template*). This makes sure that we delay parsing the bodies of
inline member functions until after we're out of the outermost
class (template) scope.
- Since the bodies of member functions are always parsed
"out-of-line", even when they were declared in-line, teach
unqualified name lookup to look into the (semantic) parents.
- Use the new InstantiateDeclRef to handle the instantiation of a
reference to a declaration (in DeclRefExpr), which drastically
simplifies template instantiation for DeclRefExprs.
- When we're instantiating a ParmVarDecl, it must be in the current
instantiation scope, so only look there.
Also, remove the #if 0's and FIXME's from the dynarray example, which
now compiles and executes thanks to Anders and Eli.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72481 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index c53b0f071c..ee14213876 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -1067,7 +1067,9 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, // // FIXME: Only function bodies and constructor ctor-initializers are // parsed correctly, fix the rest. - if (!CurScope->getParent()->isClassScope()) { + if (!CurScope->getParent()->isClassScope() && + !(CurScope->getParent()->isTemplateParamScope() && + CurScope->getParent()->getParent()->isClassScope())) { // We are not inside a nested class. This class and its nested classes // are complete and we can parse the delayed portions of method // declarations and the lexed inline method definitions. |