diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp b/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp index 49b119b..79cc21a 100644 --- a/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp +++ b/contrib/llvm/tools/clang/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<NamespaceDecl *>(NS); return FindOrInsert(Context, Mockup); } @@ -248,7 +249,6 @@ NestedNameSpecifier::print(raw_ostream &OS, // Fall through to print the type. case TypeSpec: { - std::string TypeStr; const Type *T = getAsType(); PrintingPolicy InnerPolicy(Policy); @@ -270,15 +270,12 @@ NestedNameSpecifier::print(raw_ostream &OS, SpecType->getTemplateName().print(OS, InnerPolicy, true); // Print the template argument list. - TypeStr = TemplateSpecializationType::PrintTemplateArgumentList( - SpecType->getArgs(), - SpecType->getNumArgs(), - InnerPolicy); + TemplateSpecializationType::PrintTemplateArgumentList( + OS, SpecType->getArgs(), SpecType->getNumArgs(), InnerPolicy); } else { // Print the type normally - TypeStr = QualType(T, 0).getAsString(InnerPolicy); + QualType(T, 0).print(OS, InnerPolicy); } - OS << TypeStr; break; } } |