Make sure Sema::ParsedFreeStandingDeclSpec() returns a decl representing the type.
Adding basic printing to StmtPrinter::PrintRawDecl().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44208 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtPrinter.cpp b/AST/StmtPrinter.cpp
index d96a048..fa3eb84 100644
--- a/AST/StmtPrinter.cpp
+++ b/AST/StmtPrinter.cpp
@@ -133,8 +133,16 @@
         PrintExpr(V->getInit());
       }
     }
+  } else if (TagDecl *TD = dyn_cast<TagDecl>(D)) {
+    // print a free standing tag decl (e.g. "struct x;"). 
+    OS << TD->getKindName();
+    OS << " ";
+    if (const IdentifierInfo *II = TD->getIdentifier())
+      OS << II->getName();
+    else
+      OS << "<anonymous>";
+    // FIXME: print tag bodies.
   } else {
-    // FIXME: "struct x;"
     assert(0 && "Unexpected decl");
   }
 }