Skip to content

Commit a1d64f8

Browse files
committed
issue doxygen#11708 [BUG] Variadic macro expansion doesn't work when the arguments contain comments starting with //
When having: ``` /** * @brief My struct A. */ typedef PACK(struct { int struct_a_1; ///< Description of struct_a_1 int struct_a_2; // This comment causes the problem }) my_structA_t; ``` and ``` PREDEFINED = PACK(...)=__VA_ARGS__ ``` this will translate during the preprocessing into: ``` /** * @brief My struct A. */ typedef // This comment causes the problem struct { int struct_a_1; /**< Description of struct_a_1 */ int struct_a_2; } my_structA_t; ``` Note the strange place of the `//` comment The problem is that the `//` comment lands in the "catch all" rule: ``` <*>{CPPC}[/!]? ``` instead of having an own rule with the `FindDefineArgs` which retains the comment at the regular place.
1 parent f1ec8b7 commit a1d64f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/pre.l

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,9 @@ WSopt [ \t\r]*
897897
<FindDefineArgs>{CPPC}[/!].*\n { // replace C++ single line style comment by C style comment
898898
yyextra->defArgsStr+=QCString("/**")+&yytext[3]+" */";
899899
}
900+
<FindDefineArgs>{CPPC}.*\n { // replace C++ single line style comment by C style comment
901+
yyextra->defArgsStr+=QCString("/*")+&yytext[2]+" */";
902+
}
900903
<FindDefineArgs>\" {
901904
yyextra->defArgsStr+=*yytext;
902905
BEGIN(ReadString);

0 commit comments

Comments
 (0)