diff options
author | Abramo Bagnara <abramo.bagnara@gmail.com> | 2012-09-05 09:55:10 +0000 |
---|---|---|
committer | Abramo Bagnara <abramo.bagnara@gmail.com> | 2012-09-05 09:55:10 +0000 |
commit | 536afbeb5609db87d98da8402ed0fd58f61f5d3a (patch) | |
tree | f8811593686dc31bb5a7f3c1af4c1cced907320a /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 4f216d38201d8fcb0ffd76f8984f4da052b12f5f (diff) |
Do not add using directives to a function decl context when instantiating.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163208 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 69b72c5faa..28e4116534 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1813,7 +1813,12 @@ Decl *TemplateDeclInstantiator::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) { D->getIdentLocation(), D->getNominatedNamespace(), D->getCommonAncestor()); - Owner->addDecl(Inst); + + // Add the using directive to its declaration context + // only if this is not a function or method. + if (!Owner->isFunctionOrMethod()) + Owner->addDecl(Inst); + return Inst; } |