From da033cdebeb5fa64b2b5d37e132b764c3aaeddbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Wed, 19 Apr 2017 17:17:30 +0200 Subject: [PATCH] Properly handle anonymous entities in tool --- tool/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tool/main.cpp b/tool/main.cpp index 6c3cbef..afcbab3 100644 --- a/tool/main.cpp +++ b/tool/main.cpp @@ -30,7 +30,11 @@ void print_error(const std::string& msg) void print_entity(std::ostream& out, const cppast::cpp_entity& e) { // print name and the kind of the entity - out << e.name() << " (" << cppast::to_string(e.kind()) << ")"; + if (!e.name().empty()) + out << e.name(); + else + out << ""; + out << " (" << cppast::to_string(e.kind()) << ")"; // print whether or not it is a definition if (cppast::is_definition(e))