summaryrefslogtreecommitdiffstats
path: root/src/perlmodgen.cpp
diff options
context:
space:
mode:
authorDGA45 <59612603+DGA45@users.noreply.github.com>2020-02-03 14:01:36 (GMT)
committerGitHub <noreply@github.com>2020-02-03 14:01:36 (GMT)
commit7bd775a7d8c4d74ce075ba3bb399c5dbff08b325 (patch)
treee6b99f5eaf819676982b55611a4e7b5c10e0e842 /src/perlmodgen.cpp
parentb5fa3cd1c6e6240e20d3b80a70e3f04040b32021 (diff)
downloadDoxygen-7bd775a7d8c4d74ce075ba3bb399c5dbff08b325.zip
Doxygen-7bd775a7d8c4d74ce075ba3bb399c5dbff08b325.tar.gz
Doxygen-7bd775a7d8c4d74ce075ba3bb399c5dbff08b325.tar.bz2
Fix #7556 ANSI-C anonymous (unnamed) struct/unions duplicated names
Fix ANSI-C anonymous (unnamed) struct/unions duplicated names issue
Diffstat (limited to 'src/perlmodgen.cpp')
-rw-r--r--src/perlmodgen.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp
index 4ecee5e..7da71ce 100644
--- a/src/perlmodgen.cpp
+++ b/src/perlmodgen.cpp
@@ -1573,6 +1573,7 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini
// (templateArguments(), definitionTemplateParameterLists())
QCString memType;
+ QCString name;
bool isFunc=FALSE;
switch (md->memberType())
{
@@ -1594,9 +1595,13 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini
case MemberType_Dictionary: memType="dictionary"; break;
}
+ /* DGA fix #7556 ANSI-C anonymous (unnamed) struct/unions have duplicated names (__unnamed__) */
+ name = md->name();
+ if (md->isAnonymous()) name = "__unnamed__" + name.right(name.length() - 1); /* DGA: ensure unique name */
+
m_output.openHash()
.addFieldQuotedString("kind", memType)
- .addFieldQuotedString("name", md->name())
+ .addFieldQuotedString("name", name)
.addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness()))
.addFieldQuotedString("protection", getProtectionName(md->protection()))
.addFieldBoolean("static", md->isStatic());