From 2e16aef612692d255ad6026396557bfa0f311dd4 Mon Sep 17 00:00:00 2001 From: Laurent Carlier Date: Sat, 13 Mar 2021 23:53:02 +0000 Subject: Fix bug linking C++ anonymouus workspace When using the \copydoc or \copybrief command, a variable declared inside an anonymous workspace couldn't be fixed. This patch resolves this issue. --- src/docparser.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index 75fe570..820bd1e 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -734,7 +734,21 @@ static bool findDocsForMemberOrCompound(const char *commandName, // for symbols we need to normalize the separator, so A#B, or A\B, or A.B becomes A::B cmdArg = substitute(cmdArg,"#","::"); cmdArg = substitute(cmdArg,"\\","::"); - cmdArg = substitute(cmdArg,".","::"); + static bool extractAnonNs = Config_getBool(EXTRACT_ANON_NSPACES); + if (extractAnonNs && + cmdArg.startsWith("anonymous_namespace{") + ) + { + int rightBracePos = cmdArg.find("}", std::strlen("anonymous_namespace{")); + QCString leftPart = cmdArg.left(rightBracePos + 1); + QCString rightPart = cmdArg.right(cmdArg.size() - rightBracePos - 1); + rightPart = substitute(rightPart, ".", "::"); + cmdArg = leftPart + rightPart; + } + else + { + cmdArg = substitute(cmdArg,".","::"); + } int l=(int)cmdArg.length(); -- cgit v0.12