aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Parse/Action.h5
-rw-r--r--include/clang/Parse/Parser.h3
-rw-r--r--lib/Parse/ParseDeclCXX.cpp13
-rw-r--r--lib/Sema/Sema.h5
-rw-r--r--lib/Sema/SemaDeclCXX.cpp10
5 files changed, 20 insertions, 16 deletions
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h
index f758d05792..848808938f 100644
--- a/include/clang/Parse/Action.h
+++ b/include/clang/Parse/Action.h
@@ -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();
}
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index f2f3ccf00b..66058ca225 100644
--- a/include/clang/Parse/Parser.h
+++ b/include/clang/Parse/Parser.h
@@ -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.
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 37eb34e777..4201e1cb1e 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -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
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index a7c48c838b..ab1e9d430d 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -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.
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 27d42dd88a..c9a2363422 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -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();
}