From 0e6f848327ac47d2db2d03d8b40231dc0dece049 Mon Sep 17 00:00:00 2001 From: swasti16 Date: Sun, 26 Oct 2025 09:18:01 +0530 Subject: [PATCH] Fix the typedef info in dump file --- lib/tokenize.cpp | 9 +++++++-- test/testsimplifytypedef.cpp | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) 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 += " "; 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); }