summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/NestedNameSpecifier.cpp3
-rw-r--r--clang/lib/AST/TypePrinter.cpp5
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp1
3 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/AST/NestedNameSpecifier.cpp b/clang/lib/AST/NestedNameSpecifier.cpp
index 1ff2e7177b3..858cf12dc66 100644
--- a/clang/lib/AST/NestedNameSpecifier.cpp
+++ b/clang/lib/AST/NestedNameSpecifier.cpp
@@ -229,6 +229,9 @@ NestedNameSpecifier::print(raw_ostream &OS,
break;
case Namespace:
+ if (getAsNamespace()->isAnonymousNamespace())
+ return;
+
OS << getAsNamespace()->getName();
break;
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp
index fb7b918ca2f..ec6cb48bf86 100644
--- a/clang/lib/AST/TypePrinter.cpp
+++ b/clang/lib/AST/TypePrinter.cpp
@@ -600,6 +600,9 @@ void TypePrinter::AppendScope(DeclContext *DC, std::string &Buffer) {
unsigned OldSize = Buffer.size();
if (NamespaceDecl *NS = dyn_cast<NamespaceDecl>(DC)) {
+ if (Policy.SuppressUnwrittenScope &&
+ (NS->isAnonymousNamespace() || NS->isInline()))
+ return;
if (NS->getIdentifier())
Buffer += NS->getNameAsString();
else
@@ -620,6 +623,8 @@ void TypePrinter::AppendScope(DeclContext *DC, std::string &Buffer) {
Buffer += Typedef->getIdentifier()->getName();
else if (Tag->getIdentifier())
Buffer += Tag->getIdentifier()->getName();
+ else
+ return;
}
if (Buffer.size() != OldSize)
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 4066a06e529..f964ec14836 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -1381,6 +1381,7 @@ static PrintingPolicy getCompletionPrintingPolicy(Sema &S) {
PrintingPolicy Policy = S.getPrintingPolicy();
Policy.AnonymousTagLocations = false;
Policy.SuppressStrongLifetime = true;
+ Policy.SuppressUnwrittenScope = true;
return Policy;
}
OpenPOWER on IntegriCloud