[cfe-commits] r167376 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Nick Lewycky nicholas at mxc.ca
Sun Nov 4 12:21:54 PST 2012


Author: nicholas
Date: Sun Nov  4 14:21:54 2012
New Revision: 167376

URL: http://llvm.org/viewvc/llvm-project?rev=167376&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=167376&r1=167375&r2=167376&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sun Nov  4 14:21:54 2012
@@ -5595,15 +5595,15 @@
 
     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);
     }
   }
 





More information about the cfe-commits mailing list