Skip to content

Commit a2f09d6

Browse files
committed
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"
1 parent 3bda58a commit a2f09d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4283,7 +4283,7 @@ bool getDefs(const QCString &scName,
42834283
int ni=namespaceName.findRev("::");
42844284
//printf("namespaceName=%s ni=%d\n",namespaceName.data(),ni);
42854285
bool notInNS = tmd && ni==-1 && tmd->getNamespaceDef()==0 && (mScope.isEmpty() || mScope==tmd->name());
4286-
bool sameNS = tmd && tmd->getNamespaceDef() && namespaceName.left(ni)==tmd->getNamespaceDef()->name();
4286+
bool sameNS = tmd && tmd->getNamespaceDef() && namespaceName.left(ni)==tmd->getNamespaceDef()->name() && namespaceName.mid(ni+2)==tmd->name();
42874287
//printf("notInNS=%d sameNS=%d\n",notInNS,sameNS);
42884288
if (tmd && tmd->isStrong() && // C++11 enum class
42894289
(notInNS || sameNS) &&

0 commit comments

Comments
 (0)