diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /lib/AST/NestedNameSpecifier.cpp | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'lib/AST/NestedNameSpecifier.cpp')
-rw-r--r-- | lib/AST/NestedNameSpecifier.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/AST/NestedNameSpecifier.cpp b/lib/AST/NestedNameSpecifier.cpp index 49b119b..79cc21a 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<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; } } |