]> granicus.if.org Git - clang/commitdiff
Parse the location of the 'namespace' token to ActOnNamespaceAliasDef. No functionali...
authorAnders Carlsson <andersca@mac.com>
Sat, 28 Mar 2009 22:53:22 +0000 (22:53 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 28 Mar 2009 22:53:22 +0000 (22:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67961 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Action.h
include/clang/Parse/Parser.h
lib/Parse/ParseDeclCXX.cpp
lib/Sema/Sema.h
lib/Sema/SemaDeclCXX.cpp

index f758d057923c5b4c8389e8248f06b511d2867f79..848808938f9e84bd1d1a897b5a66c7f0f41459e9 100644 (file)
@@ -848,11 +848,12 @@ public:
   /// ActOnNamespaceAliasDef - This is called when a namespace alias definition
   /// is parsed.
   virtual DeclPtrTy ActOnNamespaceAliasDef(Scope *CurScope,
+                                           SourceLocation NamespaceLoc,
                                            SourceLocation AliasLoc,
                                            IdentifierInfo *Alias,
                                            const CXXScopeSpec &SS,
-                                           SourceLocation NamespaceLoc,
-                                           IdentifierInfo *NamespaceName) {
+                                           SourceLocation IdentLoc,
+                                           IdentifierInfo *Ident) {
     return DeclPtrTy();
   }
                                          
index f2f3ccf00b9b5c137145854b7ed2d945c1bbd7d4..66058ca2256d75cf99ed0330dbb8cf6f17364202 100644 (file)
@@ -997,7 +997,8 @@ private:
   DeclPtrTy ParseUsingDirective(unsigned Context, SourceLocation UsingLoc);
   DeclPtrTy ParseUsingDeclaration(unsigned Context, SourceLocation UsingLoc);
   DeclPtrTy ParseStaticAssertDeclaration();
-  DeclPtrTy ParseNamespaceAlias(SourceLocation AliasLoc, IdentifierInfo *Alias);
+  DeclPtrTy ParseNamespaceAlias(SourceLocation NamespaceLoc,
+                                SourceLocation AliasLoc, IdentifierInfo *Alias);
   
   //===--------------------------------------------------------------------===//
   // C++ 9: classes [class] and C structs/unions.
index 37eb34e7776cb0e16e2461f345c02487644df5ea..4201e1cb1eb2aee62181f14c513d0ee324a37697 100644 (file)
@@ -62,7 +62,7 @@ Parser::DeclPtrTy Parser::ParseNamespace(unsigned Context) {
   
   if (Tok.is(tok::equal))
     // FIXME: Verify no attributes were present.
-    return ParseNamespaceAlias(IdentLoc, Ident);
+    return ParseNamespaceAlias(NamespaceLoc, IdentLoc, Ident);
   
   if (Tok.is(tok::l_brace)) {
     SourceLocation LBrace = ConsumeBrace();
@@ -99,7 +99,8 @@ Parser::DeclPtrTy Parser::ParseNamespace(unsigned Context) {
 /// ParseNamespaceAlias - Parse the part after the '=' in a namespace
 /// alias definition.
 ///
-Parser::DeclPtrTy Parser::ParseNamespaceAlias(SourceLocation AliasLoc, 
+Parser::DeclPtrTy Parser::ParseNamespaceAlias(SourceLocation NamespaceLoc,
+                                              SourceLocation AliasLoc, 
                                               IdentifierInfo *Alias) {
   assert(Tok.is(tok::equal) && "Not equal token");
   
@@ -117,15 +118,15 @@ Parser::DeclPtrTy Parser::ParseNamespaceAlias(SourceLocation AliasLoc,
   }
 
   // Parse identifier.
-  IdentifierInfo *NamespaceName = Tok.getIdentifierInfo();
-  SourceLocation NamespaceLoc = ConsumeToken();
+  IdentifierInfo *Ident = Tok.getIdentifierInfo();
+  SourceLocation IdentLoc = ConsumeToken();
   
   // Eat the ';'.
   ExpectAndConsume(tok::semi, diag::err_expected_semi_after,
                    "namespace name", tok::semi);
   
-  return Actions.ActOnNamespaceAliasDef(CurScope, AliasLoc, Alias, SS,
-                                        NamespaceLoc, NamespaceName);
+  return Actions.ActOnNamespaceAliasDef(CurScope, NamespaceLoc, AliasLoc, Alias, 
+                                        SS, IdentLoc, Ident);
 }
 
 /// ParseLinkage - We know that the current token is a string_literal
index a7c48c838b69ad7fb96285ab670f6f88bb82320a..ab1e9d430dbcccfc63c27f35109492cf72885d17 100644 (file)
@@ -1377,11 +1377,12 @@ public:
   void PushUsingDirective(Scope *S, UsingDirectiveDecl *UDir);
 
   virtual DeclPtrTy ActOnNamespaceAliasDef(Scope *CurScope,
+                                           SourceLocation NamespaceLoc,
                                            SourceLocation AliasLoc,
                                            IdentifierInfo *Alias,
                                            const CXXScopeSpec &SS,
-                                           SourceLocation NamespaceLoc,
-                                           IdentifierInfo *NamespaceName);
+                                           SourceLocation IdentLoc,
+                                           IdentifierInfo *Ident);
   
   /// AddCXXDirectInitializerToDecl - This action is called immediately after 
   /// ActOnDeclarator, when a C++ direct initializer is present.
index 27d42dd88a5f9ae7bad844691f33f3ce7394f96c..c9a236342248da7a217c675df530f9c9c33d38fe 100644 (file)
@@ -1677,11 +1677,12 @@ void Sema::PushUsingDirective(Scope *S, UsingDirectiveDecl *UDir) {
 }
 
 Sema::DeclPtrTy Sema::ActOnNamespaceAliasDef(Scope *S, 
+                                             SourceLocation NamespaceLoc,
                                              SourceLocation AliasLoc,
                                              IdentifierInfo *Alias,
                                              const CXXScopeSpec &SS,
-                                             SourceLocation NamespaceLoc,
-                                             IdentifierInfo *NamespaceName) {
+                                             SourceLocation IdentLoc,
+                                             IdentifierInfo *Ident) {
   
   // Check if we have a previous declaration with the same name.
   if (NamedDecl *PrevDecl = LookupName(S, Alias, LookupOrdinaryName)) {
@@ -1695,10 +1696,9 @@ Sema::DeclPtrTy Sema::ActOnNamespaceAliasDef(Scope *S,
   }
 
   // Lookup the namespace name.
-  LookupResult R = LookupParsedName(S, &SS, NamespaceName,
-                                    LookupNamespaceName, false);
+  LookupResult R = LookupParsedName(S, &SS, Ident, LookupNamespaceName, false);
   if (R.isAmbiguous()) {
-    DiagnoseAmbiguousLookup(R, NamespaceName, NamespaceLoc);
+    DiagnoseAmbiguousLookup(R, Ident, IdentLoc);
     return DeclPtrTy();
   }