From a2f09d6aae1260822fecf2f0de9c1d3fbcc312e7 Mon Sep 17 00:00:00 2001 From: Roel Standaert Date: Wed, 4 Dec 2019 00:32:28 +0100 Subject: Fix incorrect reference resolving of enum class values When they share enum value names inside the same namespace. This is a proposed fix for issue #7427: "Incorrect resolving of references to enum class values with shared names inside the same namespace" --- src/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index 5868b62..570a09c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -4283,7 +4283,7 @@ bool getDefs(const QCString &scName, int ni=namespaceName.findRev("::"); //printf("namespaceName=%s ni=%d\n",namespaceName.data(),ni); bool notInNS = tmd && ni==-1 && tmd->getNamespaceDef()==0 && (mScope.isEmpty() || mScope==tmd->name()); - bool sameNS = tmd && tmd->getNamespaceDef() && namespaceName.left(ni)==tmd->getNamespaceDef()->name(); + bool sameNS = tmd && tmd->getNamespaceDef() && namespaceName.left(ni)==tmd->getNamespaceDef()->name() && namespaceName.mid(ni+2)==tmd->name(); //printf("notInNS=%d sameNS=%d\n",notInNS,sameNS); if (tmd && tmd->isStrong() && // C++11 enum class (notInNS || sameNS) && -- cgit v0.12