From 4b7631bc011ce36dbc8f664c518668f0ba5d18a9 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sun, 4 Nov 2012 20:21:54 +0000 Subject: [PATCH] Put the usage-directive inside the nearest namespace or TU decl. We don't want to have UsingDirectiveDecl inside anything other than those two. No user-visible functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167376 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDeclCXX.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index f0bd810574..f9eb9ebc99 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -5595,15 +5595,15 @@ Decl *Sema::ActOnStartNamespaceDef(Scope *NamespcScope, if (!PrevNS) { UsingDirectiveDecl* UD - = UsingDirectiveDecl::Create(Context, CurContext, + = UsingDirectiveDecl::Create(Context, Parent, /* 'using' */ LBrace, /* 'namespace' */ SourceLocation(), /* qualifier */ NestedNameSpecifierLoc(), /* identifier */ SourceLocation(), Namespc, - /* Ancestor */ CurContext); + /* Ancestor */ Parent); UD->setImplicit(); - CurContext->addDecl(UD); + Parent->addDecl(UD); } } -- 2.40.0