summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-16 16:54:17 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-16 16:54:17 +0000
commitfc6c3e73cdc9005035612c0264ea7ccf85383403 (patch)
tree4689221a2a5423c2e96f640e675c3066b49121db /clang/lib/Sema/SemaTemplate.cpp
parent8a39c807e2c95ea5e2c46617441f9a56bf1e702b (diff)
downloadbcm5719-llvm-fc6c3e73cdc9005035612c0264ea7ccf85383403.tar.gz
bcm5719-llvm-fc6c3e73cdc9005035612c0264ea7ccf85383403.zip
When performing template name lookup for a dependent member access
expression such as the "foo" in "this->blah.foo<1, 2>", and we can't look into the type of "this->blah" (e.g., because it is dependent), look into the local scope of a template of the same name. Fixes <rdar://problem/8198511>. llvm-svn: 108531
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index f121954eed6..c654e008b50 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -238,13 +238,10 @@ void Sema::LookupTemplateName(LookupResult &Found,
// expression. If the identifier is not found, it is then looked up in
// the context of the entire postfix-expression and shall name a class
// or function template.
- //
- // FIXME: When we're instantiating a template, do we actually have to
- // look in the scope of the template? Seems fishy...
if (S) LookupName(Found, S);
ObjectTypeSearchedInScope = true;
}
- } else if (isDependent) {
+ } else if (isDependent && (!S || ObjectType.isNull())) {
// We cannot look into a dependent object type or nested nme
// specifier.
MemberOfUnknownSpecialization = true;
@@ -282,8 +279,11 @@ void Sema::LookupTemplateName(LookupResult &Found,
}
FilterAcceptableTemplateNames(Context, Found);
- if (Found.empty())
+ if (Found.empty()) {
+ if (isDependent)
+ MemberOfUnknownSpecialization = true;
return;
+ }
if (S && !ObjectType.isNull() && !ObjectTypeSearchedInScope) {
// C++ [basic.lookup.classref]p1:
OpenPOWER on IntegriCloud