From 8441fffda14c5d9ac704f24173fcb117d4999a8e Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Wed, 23 Jan 2013 17:06:56 +0000 Subject: [PATCH] Add constness for NestedNameSpecifier::Create parameter git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173274 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/NestedNameSpecifier.h | 2 +- lib/AST/NestedNameSpecifier.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/clang/AST/NestedNameSpecifier.h b/include/clang/AST/NestedNameSpecifier.h index bf9e1cbc76..58f39862b1 100644 --- a/include/clang/AST/NestedNameSpecifier.h +++ b/include/clang/AST/NestedNameSpecifier.h @@ -117,7 +117,7 @@ public: /// \brief Builds a nested name specifier that names a namespace. static NestedNameSpecifier *Create(const ASTContext &Context, NestedNameSpecifier *Prefix, - NamespaceDecl *NS); + const NamespaceDecl *NS); /// \brief Builds a nested name specifier that names a namespace alias. static NestedNameSpecifier *Create(const ASTContext &Context, diff --git a/lib/AST/NestedNameSpecifier.cpp b/lib/AST/NestedNameSpecifier.cpp index 49b119b8e0..719df5984b 100644 --- a/lib/AST/NestedNameSpecifier.cpp +++ b/lib/AST/NestedNameSpecifier.cpp @@ -57,7 +57,8 @@ NestedNameSpecifier::Create(const ASTContext &Context, NestedNameSpecifier * NestedNameSpecifier::Create(const ASTContext &Context, - NestedNameSpecifier *Prefix, NamespaceDecl *NS) { + NestedNameSpecifier *Prefix, + const NamespaceDecl *NS) { assert(NS && "Namespace cannot be NULL"); assert((!Prefix || (Prefix->getAsType() == 0 && Prefix->getAsIdentifier() == 0)) && @@ -65,7 +66,7 @@ NestedNameSpecifier::Create(const ASTContext &Context, NestedNameSpecifier Mockup; Mockup.Prefix.setPointer(Prefix); Mockup.Prefix.setInt(StoredNamespaceOrAlias); - Mockup.Specifier = NS; + Mockup.Specifier = const_cast(NS); return FindOrInsert(Context, Mockup); }