@@ -531,8 +531,11 @@ static void stripQualifiers(QCString &typeStr)
531531 typeStr.stripPrefix (" friend " );
532532 while (!done)
533533 {
534- if (typeStr.stripPrefix (" static " ));
535- else if (typeStr.stripPrefix (" virtual " ));
534+ if (typeStr.stripPrefix (" static " )) {}
535+ else if (typeStr.stripPrefix (" constexpr " )) {}
536+ else if (typeStr.stripPrefix (" consteval " )) {}
537+ else if (typeStr.stripPrefix (" constinit " )) {}
538+ else if (typeStr.stripPrefix (" virtual " )) {}
536539 else if (typeStr==" virtual" ) typeStr=" " ;
537540 else done=TRUE ;
538541 }
@@ -557,6 +560,49 @@ static QCString memberOutputFileBase(const MemberDef *md)
557560 return md->getOutputFileBase ();
558561}
559562
563+ static QCString extractNoExcept (QCString &argsStr)
564+ {
565+ QCString expr;
566+ // printf("extractNoExcept(%s)\n",qPrint(argsStr));
567+ int i = argsStr.find (" noexcept(" );
568+ if (i!=-1 )
569+ {
570+ int bracketCount = 1 ;
571+ size_t p = i+9 ;
572+ bool found = false ;
573+ bool insideString = false ;
574+ bool insideChar = false ;
575+ char pc = 0 ;
576+ while (!found && p<argsStr.length ())
577+ {
578+ char c = argsStr[p++];
579+ if (insideString)
580+ {
581+ if (c==' "' && pc!=' \\ ' ) insideString=false ;
582+ }
583+ else if (insideChar)
584+ {
585+ if (c==' \' ' && pc!=' \\ ' ) insideChar=false ;
586+ }
587+ else
588+ {
589+ switch (c)
590+ {
591+ case ' (' : bracketCount++; break ;
592+ case ' )' : bracketCount--; found = bracketCount==0 ; break ;
593+ case ' "' : insideString = true ; break ;
594+ case ' \' ' : insideChar = true ; break ;
595+ }
596+ }
597+ pc = c;
598+ }
599+ expr = argsStr.mid (i+9 ,p-i-10 );
600+ argsStr = (argsStr.left (i) + argsStr.mid (p)).stripWhiteSpace ();
601+ }
602+ // printf("extractNoExcept -> argsStr='%s', expr='%s'\n",qPrint(argsStr),qPrint(expr));
603+ return expr;
604+ }
605+
560606
561607static void generateXMLForMember (const MemberDef *md,TextStream &ti,TextStream &t,const Definition *def)
562608{
@@ -605,6 +651,30 @@ static void generateXMLForMember(const MemberDef *md,TextStream &ti,TextStream &
605651 }
606652
607653 QCString nameStr = md->name ();
654+ QCString typeStr = md->typeString ();
655+ QCString argsStr = md->argsString ();
656+ QCString defStr = md->definition ();
657+ defStr.stripPrefix (" constexpr " );
658+ defStr.stripPrefix (" consteval " );
659+ defStr.stripPrefix (" constinit " );
660+ stripAnonymousMarkers (typeStr);
661+ stripQualifiers (typeStr);
662+ if (typeStr==" auto" )
663+ {
664+ int i=argsStr.findRev (" ->" );
665+ if (i!=-1 ) // move trailing return type into type and strip it from argsStr
666+ {
667+ typeStr=argsStr.mid (i+2 ).stripWhiteSpace ();
668+ argsStr=argsStr.left (i).stripWhiteSpace ();
669+ i=defStr.find (" auto " );
670+ if (i!=-1 )
671+ {
672+ defStr=defStr.left (i)+typeStr+defStr.mid (i+4 );
673+ }
674+ }
675+ }
676+ QCString noExceptExpr = extractNoExcept (argsStr);
677+
608678 stripAnonymousMarkers (nameStr);
609679 ti << " <member refid=\" " << memberOutputFileBase (md)
610680 << " _1" << md->anchor () << " \" kind=\" " << memType << " \" ><name>"
@@ -642,6 +712,11 @@ static void generateXMLForMember(const MemberDef *md,TextStream &ti,TextStream &
642712 if (md->isStatic ()) t << " yes" ; else t << " no" ;
643713 t << " \" " ;
644714
715+ if (md->isNoDiscard ())
716+ {
717+ t << " nodiscard=\" yes\" " ;
718+ }
719+
645720 if (md->isConstExpr ())
646721 {
647722 t << " constexpr=\" yes\" " ;
@@ -714,6 +789,11 @@ static void generateXMLForMember(const MemberDef *md,TextStream &ti,TextStream &
714789 t << " noexcept=\" yes\" " ;
715790 }
716791
792+ if (!noExceptExpr.isEmpty ())
793+ {
794+ t << " noexceptexpression=\" " << convertToXML (noExceptExpr) << " \" " ;
795+ }
796+
717797 if (al.volatileSpecifier ())
718798 {
719799 t << " volatile=\" yes\" " ;
@@ -859,20 +939,16 @@ static void generateXMLForMember(const MemberDef *md,TextStream &ti,TextStream &
859939 )
860940 {
861941 writeMemberTemplateLists (md,t);
862- QCString typeStr = md->typeString ();
863- stripAnonymousMarkers (typeStr);
864- stripQualifiers (typeStr);
865942 t << " <type>" ;
866943 linkifyText (TextGeneratorXMLImpl (t),def,md->getBodyDef (),md,typeStr);
867944 t << " </type>\n " ;
868- QCString defStr = md->definition ();
869945 if (md->isTypeAlias ())
870946 {
871947 defStr+=" = " +md->initializer ();
872948 }
873949 stripAnonymousMarkers (defStr);
874950 t << " <definition>" << convertToXML (defStr) << " </definition>\n " ;
875- t << " <argsstring>" << convertToXML (md-> argsString () ) << " </argsstring>\n " ;
951+ t << " <argsstring>" << convertToXML (argsStr ) << " </argsstring>\n " ;
876952 }
877953
878954 if (md->memberType () == MemberType_Enumeration)
0 commit comments