diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp
index 054b14dbd0d..1f2ec5c5b2c 100644
--- a/lib/tokenize.cpp
+++ b/lib/tokenize.cpp
@@ -6285,6 +6285,7 @@ std::string Tokenizer::dumpTypedefInfo() const
std::string outs = " ";
outs += '\n';
for (const TypedefInfo &typedefInfo: mTypedefInfo) {
+ const bool toks = !typedefInfo.typedefInfoTokens.empty();
outs += " ";
+ if (toks)
+ outs += ">";
+ else
+ outs += "/>";
outs += '\n';
for (const auto& t : typedefInfo.typedefInfoTokens) {
outs += " ";
outs += '\n';
}
+ if (toks)
+ outs += " \n";
}
outs += " ";
outs += '\n';
diff --git a/test/testsimplifytypedef.cpp b/test/testsimplifytypedef.cpp
index 1f2701043bb..b13a0113b9e 100644
--- a/test/testsimplifytypedef.cpp
+++ b/test/testsimplifytypedef.cpp
@@ -4556,7 +4556,7 @@ class TestSimplifyTypedef : public TestFixture {
" typedef fp16 ( *pfp16 ) ( void );\n"
"}\n");
ASSERT_EQUALS(" \n"
- " \n"
+ " \n"
" \n"
" \n"
" \n"
@@ -4567,8 +4567,9 @@ class TestSimplifyTypedef : public TestFixture {
" \n"
" \n"
" \n"
+ " \n"
" \n"
- " \n"
+ " \n"
" \n"
" \n"
" \n"
@@ -4586,6 +4587,7 @@ class TestSimplifyTypedef : public TestFixture {
" \n"
" \n"
" \n"
+ " \n"
" \n",xml);
}