]> granicus.if.org Git - clang/commitdiff
Let StmtDumper.cpp handle using declarations.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Tue, 4 May 2010 10:20:17 +0000 (10:20 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Tue, 4 May 2010 10:20:17 +0000 (10:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103006 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/StmtDumper.cpp

index ca62ed12d058cb649af2fe46d134ffeaf09ba75d..a11e313fa8aebfe008d1a9e0dfcf025a2b128db9 100644 (file)
@@ -260,6 +260,13 @@ void StmtDumper::DumpDeclarator(Decl *D) {
     else
       ns = "<anonymous>";
     OS << '"' << UD->getDeclKindName() << ns << ";\"";
+  } else if (UsingDecl *UD = dyn_cast<UsingDecl>(D)) {
+    // print using decl (e.g. "using std::string;")
+    const char *tn = UD->isTypeName() ? "typename " : "";
+    OS << '"' << UD->getDeclKindName() << tn;
+    UD->getTargetNestedNameDecl()->print(OS,
+        PrintingPolicy(UD->getASTContext().getLangOptions()));
+    OS << ";\"";
   } else {
     assert(0 && "Unexpected decl");
   }