Push nested-name-specifier source location information into using directives.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126489 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 89b2263..fb65dd8 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -3623,8 +3623,7 @@
         = UsingDirectiveDecl::Create(Context, CurContext,
                                      /* 'using' */ LBrace,
                                      /* 'namespace' */ SourceLocation(),
-                                     /* qualifier */ SourceRange(),
-                                     /* NNS */ NULL,
+                                     /* qualifier */ NestedNameSpecifierLoc(),
                                      /* identifier */ SourceLocation(),
                                      Namespc,
                                      /* Ancestor */ CurContext);
@@ -3768,8 +3767,7 @@
       CommonAncestor = CommonAncestor->getParent();
 
     UDir = UsingDirectiveDecl::Create(Context, CurContext, UsingLoc, NamespcLoc,
-                                      SS.getRange(),
-                                      (NestedNameSpecifier *)SS.getScopeRep(),
+                                      SS.getWithLocInContext(Context),
                                       IdentLoc, Named, CommonAncestor);
     PushUsingDirective(S, UDir);
   } else {
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index c96430a..1d75da7 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1638,12 +1638,13 @@
 }
 
 Decl *TemplateDeclInstantiator::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) {
-  // Using directives are never dependent, so they require no explicit
+  // Using directives are never dependent (and never contain any types or
+  // expressions), so they require no explicit instantiation work.
   
   UsingDirectiveDecl *Inst
     = UsingDirectiveDecl::Create(SemaRef.Context, Owner, D->getLocation(),
                                  D->getNamespaceKeyLocation(), 
-                                 D->getQualifierRange(), D->getQualifier(), 
+                                 D->getQualifierLoc(),
                                  D->getIdentLocation(), 
                                  D->getNominatedNamespace(), 
                                  D->getCommonAncestor());