summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-12 16:11:24 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-12 16:11:24 +0000
commitbf3a826f2cf7975cf6d92de325e00e50ede04cba (patch)
treed4b6655c22cf32518b55ae197c2f8a995243fe69 /clang/lib/Sema/SemaTemplate.cpp
parent0a0a829beaf5d1030f56bd3290df593a9f6f4a76 (diff)
downloadbcm5719-llvm-bf3a826f2cf7975cf6d92de325e00e50ede04cba.tar.gz
bcm5719-llvm-bf3a826f2cf7975cf6d92de325e00e50ede04cba.zip
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>. llvm-svn: 148028
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index bcdf32b5bc4..6c2a94aa9c5 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud