diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-27 18:19:34 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-27 18:19:34 +0000 |
commit | c96be1ea33cdf63d07cec48d18fe8e3afea48f8d (patch) | |
tree | 22f6b578421421f9afcdadacabdd272bff442dea /lib/AST/Type.cpp | |
parent | b170ca5f4a8397c10e52050ff5df6885a3e6eca9 (diff) |
During template instantiation, set the naming class of
UnresolvedLookupExpr and UnresolvedMemberExpr by substituting the
naming class we computed when building the expression in the
template...
... which we didn't always do correctly. Teach
UnresolvedMemberExpr::getNamingClass() all about the new
representation of injected-class-names in templates, so that it can
return a naming class that is the current instantiation.
Also, when decomposing a template-id into its template name and its
arguments, be sure to set the naming class on the LookupResult
structure.
Fixes PR6947 the right way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 52ee60b984..05e7fdc49e 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -415,6 +415,16 @@ const CXXRecordDecl *Type::getCXXRecordDeclForPointerType() const { return 0; } +CXXRecordDecl *Type::getAsCXXRecordDecl() const { + if (const RecordType *RT = getAs<RecordType>()) + return dyn_cast<CXXRecordDecl>(RT->getDecl()); + else if (const InjectedClassNameType *Injected + = getAs<InjectedClassNameType>()) + return Injected->getDecl(); + + return 0; +} + bool Type::isIntegerType() const { if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType)) return BT->getKind() >= BuiltinType::Bool && |