@@ -831,6 +831,7 @@ bool cxxParserParseEnum(void)
831831 tagEntryInfo * tag = cxxTagBegin (CXXTagKindENUM ,pEnumName );
832832
833833 int iCorkQueueIndex = CORK_NIL ;
834+ int iCorkQueueIndexFQ = CORK_NIL ;
834835
835836 if (tag )
836837 {
@@ -852,7 +853,7 @@ bool cxxParserParseEnum(void)
852853 if (bIsScopedEnum )
853854 pszProperties = cxxTagSetProperties (CXXTagPropertyScopedEnum );
854855
855- iCorkQueueIndex = cxxTagCommit ();
856+ iCorkQueueIndex = cxxTagCommit (& iCorkQueueIndexFQ );
856857
857858 if (pszProperties )
858859 vStringDelete (pszProperties );
@@ -894,7 +895,7 @@ bool cxxParserParseEnum(void)
894895 if (tag )
895896 {
896897 tag -> isFileScope = !isInputHeaderFile ();
897- cxxTagCommit ();
898+ cxxTagCommit (NULL );
898899 }
899900 }
900901
@@ -906,7 +907,11 @@ bool cxxParserParseEnum(void)
906907 }
907908
908909 if (iCorkQueueIndex > CORK_NIL )
910+ {
909911 cxxParserMarkEndLineForTagInCorkQueue (iCorkQueueIndex );
912+ if (iCorkQueueIndexFQ > CORK_NIL )
913+ cxxParserMarkEndLineForTagInCorkQueue (iCorkQueueIndexFQ );
914+ }
910915
911916 while (iPushedScopes > 0 )
912917 {
@@ -1261,6 +1266,7 @@ static bool cxxParserParseClassStructOrUnionInternal(
12611266 tagEntryInfo * tag = cxxTagBegin (uTagKind ,pClassName );
12621267
12631268 int iCorkQueueIndex = CORK_NIL ;
1269+ int iCorkQueueIndexFQ = CORK_NIL ;
12641270
12651271 bool bGotTemplate = g_cxx .pTemplateTokenChain &&
12661272 (g_cxx .pTemplateTokenChain -> iCount > 0 ) &&
@@ -1315,7 +1321,7 @@ static bool cxxParserParseClassStructOrUnionInternal(
13151321
13161322 tag -> isFileScope = !isInputHeaderFile ();
13171323
1318- iCorkQueueIndex = cxxTagCommit ();
1324+ iCorkQueueIndex = cxxTagCommit (& iCorkQueueIndexFQ );
13191325
13201326 }
13211327
@@ -1343,7 +1349,11 @@ static bool cxxParserParseClassStructOrUnionInternal(
13431349 }
13441350
13451351 if (iCorkQueueIndex > CORK_NIL )
1352+ {
13461353 cxxParserMarkEndLineForTagInCorkQueue (iCorkQueueIndex );
1354+ if (iCorkQueueIndexFQ > CORK_NIL )
1355+ cxxParserMarkEndLineForTagInCorkQueue (iCorkQueueIndexFQ );
1356+ }
13471357
13481358 iPushedScopes ++ ;
13491359 while (iPushedScopes > 0 )
@@ -1505,12 +1515,14 @@ void cxxParserAnalyzeOtherStatement(void)
15051515 // out its proper scope. Better avoid emitting this one.
15061516 CXX_DEBUG_PRINT ("But it has been preceded by the 'friend' keyword: this is not a real prototype" );
15071517 } else {
1508- int piCorkQueueIndex ;
1509- int iScopesPushed = cxxParserEmitFunctionTags (& oInfo ,CXXTagKindPROTOTYPE ,CXXEmitFunctionTagsPushScopes , & piCorkQueueIndex );
1510- if (piCorkQueueIndex != CORK_NIL )
1518+ int iCorkQueueIndex , iCorkQueueIndexFQ ;
1519+ int iScopesPushed = cxxParserEmitFunctionTags (& oInfo ,CXXTagKindPROTOTYPE ,CXXEmitFunctionTagsPushScopes ,& iCorkQueueIndex , & iCorkQueueIndexFQ );
1520+ if (iCorkQueueIndex != CORK_NIL )
15111521 {
15121522 CXXToken * t = cxxTokenChainLast (g_cxx .pTokenChain );
1513- cxxParserSetEndLineForTagInCorkQueue (piCorkQueueIndex , t -> iLineNumber );
1523+ cxxParserSetEndLineForTagInCorkQueue (iCorkQueueIndex , t -> iLineNumber );
1524+ if (iCorkQueueIndexFQ != CORK_NIL )
1525+ cxxParserSetEndLineForTagInCorkQueue (iCorkQueueIndexFQ , t -> iLineNumber );
15141526 }
15151527
15161528 if (bPrototypeParams )
0 commit comments