Do not add using directives to a function decl context when instantiating.

llvm-svn: 163208
This commit is contained in:
Abramo Bagnara 2012-09-05 09:55:10 +00:00
parent 4d45b9b784
commit 8843f9f3d4
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}