@@ -260,6 +260,14 @@ void cxxTagUseTokensInRangeAsPartOfDefTags(int iCorkIndex, CXXToken * pFrom, CXX
260260 }
261261}
262262
263+ static bool countSameKindEntry (int corkIndex ,
264+ tagEntryInfo * entry ,
265+ void * data )
266+ {
267+ unsigned int * uKind = data ;
268+ return (entry -> kindIndex == * uKind );
269+ }
270+
263271tagEntryInfo * cxxTagBegin (unsigned int uKind ,CXXToken * pToken )
264272{
265273 kindDefinition * pKindDefinitions = g_cxx .pKindDefinitions ;
@@ -288,6 +296,14 @@ tagEntryInfo * cxxTagBegin(unsigned int uKind,CXXToken * pToken)
288296 g_oCXXTag .extensionFields .scopeName = cxxScopeGetFullName ();
289297 // scopeIndex is used in the parser internally.
290298 g_oCXXTag .extensionFields .scopeIndex = cxxScopeGetDefTag ();
299+ if (g_oCXXTag .extensionFields .scopeIndex != CORK_NIL )
300+ {
301+ if (uKind == CXXTagKindMEMBER || uKind == CXXTagKindENUMERATOR )
302+ g_oCXXTag .extensionFields .nth =
303+ (short ) countEntriesInScope (g_oCXXTag .extensionFields .scopeIndex ,
304+ true,
305+ countSameKindEntry , & uKind );
306+ }
291307 }
292308
293309 // FIXME: meaning of "is file scope" is quite debatable...
@@ -654,6 +670,8 @@ int cxxTagCommit(int *piCorkQueueIndexFQ)
654670#endif
655671
656672 int iCorkQueueIndex = makeTagEntry (& g_oCXXTag );
673+ if (iCorkQueueIndex != CORK_NIL )
674+ registerEntry (iCorkQueueIndex );
657675
658676 // Handle --extra=+q
659677 if (!isXtagEnabled (XTAG_QUALIFIED_TAGS ))
0 commit comments