diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-05-21 21:25:08 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-05-21 21:25:08 +0000 |
| commit | 9f44d1453b67a6d9e7acb8a68146fc23261c3e57 (patch) | |
| tree | 346a27731549b5fb020337d25ba47b42f3bb7574 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
| parent | 2c8bdead9e78aa63a19536cf0af453cbc1955533 (diff) | |
| download | bcm5719-llvm-9f44d1453b67a6d9e7acb8a68146fc23261c3e57.tar.gz bcm5719-llvm-9f44d1453b67a6d9e7acb8a68146fc23261c3e57.zip | |
When instantiating a function declaration within a function template,
be sure to merge its parameter scope with its parent's scope. Fixes
PR7184.
llvm-svn: 104386
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index e8cbb66694f..10d2bb119d3 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/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); |

