Add a workaround for decls that come from friend decls pointing to undeclared classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80438 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp
index 191d356..275f2db 100644
--- a/lib/AST/DeclPrinter.cpp
+++ b/lib/AST/DeclPrinter.cpp
@@ -202,7 +202,10 @@
if (PrintAccess) {
AccessSpecifier AS = D->getAccess();
- if (AS != CurAS) {
+
+ if (AS != CurAS &&
+ // FIXME: This check shouldn't be necessary.
+ D->getFriendObjectKind() == Decl::FOK_Undeclared) {
Print(AS);
Out << ":\n";
CurAS = AS;