aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-21 21:25:08 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-21 21:25:08 +0000
commitb212d9a8e10308cde5b7a1ce07bd59d8df14fa06 (patch)
tree2a4722e3e5a4c0ece973aaee1036d54dd2e73e0d /lib/Sema/SemaTemplateInstantiateDecl.cpp
parentd3573f09321f3078e802fe36c70f7750be71004d (diff)
When instantiating a function declaration within a function template,
be sure to merge its parameter scope with its parent's scope. Fixes PR7184. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index e8cbb66694..10d2bb119d 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -970,6 +970,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D,
isFriend = (D->getFriendObjectKind() != Decl::FOK_None);
bool MergeWithParentScope = (TemplateParams != 0) ||
+ Owner->isFunctionOrMethod() ||
!(isa<Decl>(Owner) &&
cast<Decl>(Owner)->isDefinedOutsideFunctionOrMethod());
Sema::LocalInstantiationScope Scope(SemaRef, MergeWithParentScope);