From 14aba76042e041b2c5e439bf4ae353a0a3c7fd73 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 24 Feb 2011 02:36:08 +0000 Subject: Teach NestedNameSpecifier to keep track of namespace aliases the same way it keeps track of namespaces. Previously, we would map from the namespace alias to its underlying namespace when building a nested-name-specifier, losing source information in the process. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126358 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/DeclSpec.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/Sema/DeclSpec.cpp') diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp index 39984974bf..f21d90f7c8 100644 --- a/lib/Sema/DeclSpec.cpp +++ b/lib/Sema/DeclSpec.cpp @@ -74,6 +74,15 @@ void CXXScopeSpec::Extend(ASTContext &Context, NamespaceDecl *Namespace, Range.setEnd(ColonColonLoc); } +void CXXScopeSpec::Extend(ASTContext &Context, NamespaceAliasDecl *Alias, + SourceLocation AliasLoc, + SourceLocation ColonColonLoc) { + ScopeRep = NestedNameSpecifier::Create(Context, ScopeRep, Alias); + if (Range.getBegin().isInvalid()) + Range.setBegin(AliasLoc); + Range.setEnd(ColonColonLoc); +} + void CXXScopeSpec::MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc) { assert(!ScopeRep && "Already have a nested-name-specifier!?"); -- cgit v1.2.3