]> granicus.if.org Git - clang/commitdiff
Add constness for NestedNameSpecifier::Create parameter
authorDmitri Gribenko <gribozavr@gmail.com>
Wed, 23 Jan 2013 17:06:56 +0000 (17:06 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Wed, 23 Jan 2013 17:06:56 +0000 (17:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173274 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/NestedNameSpecifier.h
lib/AST/NestedNameSpecifier.cpp

index bf9e1cbc764b9950072dcf8bca5fee4b2ede2059..58f39862b10228834a3b54d1ffc8b68136cf7073 100644 (file)
@@ -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,
index 49b119b8e05c5ae4cd741d4e914ceb73d1149a03..719df5984b8310f1b863f587e6e788e39a28e597 100644 (file)
@@ -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<NamespaceDecl *>(NS);
   return FindOrInsert(Context, Mockup);
 }