diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-12 16:11:24 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-12 16:11:24 +0000 |
commit | 1d7049a6eddcc1a4bd33c6a595d4ad2ae8c1cece (patch) | |
tree | 9ce770958fea31cd9dc8f2893d421d9e922ab68c /lib/Sema/SemaTemplate.cpp | |
parent | 28058d179ae40edc66135458849f1073c841bc74 (diff) |
In Objective-C++, actually compute the base type of a member access
expression for an Objective-C object or pointer type, so that we don't
attempt to treat the member name as a template. Fixes
<rdar://problem/10672501>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index bcdf32b5bc..6c2a94aa9c 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -249,6 +249,12 @@ void Sema::LookupTemplateName(LookupResult &Found, isDependent = ObjectType->isDependentType(); assert((isDependent || !ObjectType->isIncompleteType()) && "Caller should have completed object type"); + + // Template names cannot appear inside an Objective-C class or object type. + if (ObjectType->isObjCObjectOrInterfaceType()) { + Found.clear(); + return; + } } else if (SS.isSet()) { // This nested-name-specifier occurs after another nested-name-specifier, // so long into the context associated with the prior nested-name-specifier. |