summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-19 23:06:02 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-19 23:06:02 +0000
commit13d031593ebc7c6b342a3d7498ecfcf7432becad (patch)
treefcb43b6ee7d746b28cc1d0236064935a7128e8ae /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parentbb723b228af87f4decc6684d01764bcf041c5a41 (diff)
downloadbcm5719-llvm-13d031593ebc7c6b342a3d7498ecfcf7432becad.tar.gz
bcm5719-llvm-13d031593ebc7c6b342a3d7498ecfcf7432becad.zip
Correctly instantiate templates with non-type template arguments that
are local externs. Fixes <rdar://problem/8302138>. llvm-svn: 111570
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 6fc95634ab7..cfae30c0adf 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -2559,7 +2559,7 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
DeclContext *ParentDC = D->getDeclContext();
if (isa<ParmVarDecl>(D) || isa<NonTypeTemplateParmDecl>(D) ||
isa<TemplateTypeParmDecl>(D) || isa<TemplateTemplateParmDecl>(D) ||
- ParentDC->isFunctionOrMethod()) {
+ (ParentDC->isFunctionOrMethod() && ParentDC->isDependentContext())) {
// D is a local of some kind. Look into the map of local
// declarations to their instantiations.
return cast<NamedDecl>(CurrentInstantiationScope->getInstantiationOf(D));
OpenPOWER on IntegriCloud