diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-24 02:36:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-24 02:36:08 +0000 |
commit | 7b26ff912f49f787d25f4ea9677f88c2f512790f (patch) | |
tree | 3bad9490f7419343d705560bc4efbf6a1a510fa2 /clang/lib/Sema/DeclSpec.cpp | |
parent | 8e74e79145a60e4d3a49d5b85de4a15ee443022e (diff) | |
download | bcm5719-llvm-7b26ff912f49f787d25f4ea9677f88c2f512790f.tar.gz bcm5719-llvm-7b26ff912f49f787d25f4ea9677f88c2f512790f.zip |
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.
llvm-svn: 126358
Diffstat (limited to 'clang/lib/Sema/DeclSpec.cpp')
-rw-r--r-- | clang/lib/Sema/DeclSpec.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp index 39984974bfd..f21d90f7c8c 100644 --- a/clang/lib/Sema/DeclSpec.cpp +++ b/clang/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!?"); |