Skip to content

Commit

Permalink
Added test case for \ref, and fixed representation of operator->*()
Browse files Browse the repository at this point in the history
  • Loading branch information
doxygen committed Dec 21, 2018
1 parent e8b9cfa commit 2b42578
Show file tree
Hide file tree
Showing 3 changed files with 338 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,7 @@ QCString removeRedundantWhiteSpace(const QCString &s)
case '*':
if (i>0 && pc!=' ' && pc!='\t' && pc!=':' &&
pc!='*' && pc!='&' && pc!='(' && pc!='/' &&
pc!='.' && (osp<9 || (pc=='>' && osp==11)))
pc!='.' && (osp<9 || !(pc=='>' && osp==11)))
// avoid splitting &&, **, .*, operator*, operator->*
{
*dst++=' ';
Expand Down Expand Up @@ -1930,7 +1930,7 @@ QCString removeRedundantWhiteSpace(const QCString &s)
pc=c;
}
*dst++='\0';
//printf("removeRedundantWhitespace(%s)->%s\n",s.data(),growBuf);
printf("removeRedundantWhitespace(%s)->%s\n",s.data(),growBuf);
return growBuf;
}

Expand Down
287 changes: 287 additions & 0 deletions testing/074/struct_foo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="struct_foo" kind="struct" language="C++" prot="public">
<compoundname>Foo</compoundname>
<sectiondef kind="public-func">
<memberdef kind="function" id="struct_foo_1a5c036d1b3561a0e1beffe8c6799a4276" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>Foo::Foo</definition>
<argsstring>()</argsstring>
<name>Foo</name>
<briefdescription>
</briefdescription>
<detaileddescription>
<para>Constructor </para>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="074_ref.cpp" line="16" column="1"/>
</memberdef>
<memberdef kind="function" id="struct_foo_1a279debd94d894223fa8468933e2d6188" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type><ref refid="struct_foo" kindref="compound">Foo</ref> &amp;</type>
<definition>Foo&amp; Foo::operator&lt;&lt;</definition>
<argsstring>(int i)</argsstring>
<name>operator&lt;&lt;</name>
<param>
<type>int</type>
<declname>i</declname>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
<para>overloaded less than operator </para>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="074_ref.cpp" line="27" column="1"/>
</memberdef>
<memberdef kind="function" id="struct_foo_1a48bcc3de9b2f1ad09a3518a0c9f0da61" prot="public" static="no" const="yes" explicit="no" inline="no" virt="non-virtual">
<type>const <ref refid="struct_foo" kindref="compound">Foo</ref> &amp;</type>
<definition>const Foo&amp; Foo::operator&lt;&lt;</definition>
<argsstring>(int i) const</argsstring>
<name>operator&lt;&lt;</name>
<param>
<type>int</type>
<declname>i</declname>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
<para>overloaded const less than operator </para>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="074_ref.cpp" line="30" column="1"/>
</memberdef>
<memberdef kind="function" id="struct_foo_1a3a41dcf8c53f777d50676ea28400a640" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>int</type>
<definition>int Foo::operator()</definition>
<argsstring>(int i)</argsstring>
<name>operator()</name>
<param>
<type>int</type>
<declname>i</declname>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
<para>overloaded call operator </para>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="074_ref.cpp" line="33" column="1"/>
</memberdef>
<memberdef kind="function" id="struct_foo_1ae3c9c1f33cdb8b932c6eb104660a262b" prot="public" static="no" const="yes" explicit="no" inline="no" virt="non-virtual">
<type>int</type>
<definition>int Foo::operator()</definition>
<argsstring>(int i) const</argsstring>
<name>operator()</name>
<param>
<type>int</type>
<declname>i</declname>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
<para>overloaded call operator </para>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="074_ref.cpp" line="36" column="1"/>
</memberdef>
<memberdef kind="function" id="struct_foo_1aa20bd44b1bb87a652ac65170ddfa1a5a" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type><ref refid="struct_foo" kindref="compound">Foo</ref> &amp;</type>
<definition>Foo&amp; Foo::operator&amp;=</definition>
<argsstring>(const Foo &amp;rhs)</argsstring>
<name>operator&amp;=</name>
<param>
<type>const <ref refid="struct_foo" kindref="compound">Foo</ref> &amp;</type>
<declname>rhs</declname>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
<para>and equal operator </para>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="074_ref.cpp" line="39" column="1"/>
</memberdef>
<memberdef kind="function" id="struct_foo_1aa20bd44b1bb87a652ac65170ddfa1a5a" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type><ref refid="struct_foo" kindref="compound">Foo</ref> &amp;</type>
<definition>Foo&amp; Foo::operator&amp;=</definition>
<argsstring>(const Foo &amp;rhs)</argsstring>
<name>operator&amp;=</name>
<param>
<type>const <ref refid="struct_foo" kindref="compound">Foo</ref> &amp;</type>
<declname>rhs</declname>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
<para>and equal operator </para>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="074_ref.cpp" line="42" column="1"/>
</memberdef>
<memberdef kind="function" id="struct_foo_1a0514e1f5b30cbf77e1c39d7aba308656" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type>int *</type>
<definition>int* Foo::operator-&gt;*</definition>
<argsstring>(int *p)</argsstring>
<name>operator-&gt;*</name>
<param>
<type>int *</type>
<declname>p</declname>
</param>
<briefdescription>
</briefdescription>
<detaileddescription>
<para>Member pointer operator </para>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="074_ref.cpp" line="45" column="1"/>
</memberdef>
<memberdef kind="function" id="struct_foo_1a978acd73e910ce56cc169ebec8736669" prot="public" static="no" const="yes" explicit="no" inline="no" virt="non-virtual">
<type>
<ref refid="struct_foo" kindref="compound">Foo</ref>
</type>
<definition>Foo Foo::fun</definition>
<argsstring>() const</argsstring>
<name>fun</name>
<briefdescription>
<para>Fun with itself. </para>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="074_ref.cpp" line="48" column="1"/>
</memberdef>
</sectiondef>
<sectiondef kind="public-static-func">
<memberdef kind="function" id="struct_foo_1abdf64a71706807b0f946265902c530ee" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
<type>
<ref refid="struct_foo" kindref="compound">Foo</ref>
</type>
<definition>static Foo Foo::fun</definition>
<argsstring>(Foo a, Foo b)</argsstring>
<name>fun</name>
<param>
<type>
<ref refid="struct_foo" kindref="compound">Foo</ref>
</type>
<declname>a</declname>
</param>
<param>
<type>
<ref refid="struct_foo" kindref="compound">Foo</ref>
</type>
<declname>b</declname>
</param>
<briefdescription>
<para>Fun of two. </para>
</briefdescription>
<detaileddescription>
<para>
<itemizedlist>
<listitem>
<para>
<ref refid="struct_foo_1a978acd73e910ce56cc169ebec8736669" kindref="member">fun() const</ref>
</para>
</listitem>
<listitem>
<para>
<ref refid="struct_foo_1a978acd73e910ce56cc169ebec8736669" kindref="member">fun() const</ref>
</para>
</listitem>
<listitem>
<para>
<ref refid="struct_foo_1a978acd73e910ce56cc169ebec8736669" kindref="member">title</ref>
</para>
</listitem>
</itemizedlist>
</para>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="074_ref.cpp" line="24" column="1"/>
</memberdef>
</sectiondef>
<briefdescription>
<para><ref refid="struct_foo" kindref="compound">Foo</ref> class. </para>
</briefdescription>
<detaileddescription>
<para>
<simplesect kind="see">
<para><ref refid="struct_foo_1a5c036d1b3561a0e1beffe8c6799a4276" kindref="member">Foo::Foo()</ref> constructor for details. </para>
</simplesect>
<simplesect kind="see">
<para><ref refid="struct_foo" kindref="compound">Foo</ref> constant. </para>
</simplesect>
<simplesect kind="see">
<para><ref refid="struct_foo_1a279debd94d894223fa8468933e2d6188" kindref="member">less than operator</ref>. </para>
</simplesect>
<simplesect kind="see">
<para><ref refid="struct_foo_1a48bcc3de9b2f1ad09a3518a0c9f0da61" kindref="member">const less than operator</ref>. </para>
</simplesect>
<simplesect kind="see">
<para><ref refid="struct_foo_1a3a41dcf8c53f777d50676ea28400a640" kindref="member">call operator</ref>. </para>
</simplesect>
<simplesect kind="see">
<para><ref refid="struct_foo_1ae3c9c1f33cdb8b932c6eb104660a262b" kindref="member">const call operator</ref>. </para>
</simplesect>
<simplesect kind="see">
<para><ref refid="struct_foo_1aa20bd44b1bb87a652ac65170ddfa1a5a" kindref="member">and equal operator</ref>. </para>
</simplesect>
<simplesect kind="see">
<para><ref refid="struct_foo_1a0514e1f5b30cbf77e1c39d7aba308656" kindref="member">member pointer operator</ref>. </para>
</simplesect>
</para>
</detaileddescription>
<location file="074_ref.cpp" line="14" column="1" bodyfile="074_ref.cpp" bodystart="14" bodyend="49"/>
<listofallmembers>
<member refid="struct_foo_1a5c036d1b3561a0e1beffe8c6799a4276" prot="public" virt="non-virtual">
<scope>Foo</scope>
<name>Foo</name>
</member>
<member refid="struct_foo_1abdf64a71706807b0f946265902c530ee" prot="public" virt="non-virtual">
<scope>Foo</scope>
<name>fun</name>
</member>
<member refid="struct_foo_1a978acd73e910ce56cc169ebec8736669" prot="public" virt="non-virtual">
<scope>Foo</scope>
<name>fun</name>
</member>
<member refid="struct_foo_1aa20bd44b1bb87a652ac65170ddfa1a5a" prot="public" virt="non-virtual">
<scope>Foo</scope>
<name>operator&amp;=</name>
</member>
<member refid="struct_foo_1aa20bd44b1bb87a652ac65170ddfa1a5a" prot="public" virt="non-virtual">
<scope>Foo</scope>
<name>operator&amp;=</name>
</member>
<member refid="struct_foo_1a3a41dcf8c53f777d50676ea28400a640" prot="public" virt="non-virtual">
<scope>Foo</scope>
<name>operator()</name>
</member>
<member refid="struct_foo_1ae3c9c1f33cdb8b932c6eb104660a262b" prot="public" virt="non-virtual">
<scope>Foo</scope>
<name>operator()</name>
</member>
<member refid="struct_foo_1a0514e1f5b30cbf77e1c39d7aba308656" prot="public" virt="non-virtual">
<scope>Foo</scope>
<name>operator-&gt;*</name>
</member>
<member refid="struct_foo_1a279debd94d894223fa8468933e2d6188" prot="public" virt="non-virtual">
<scope>Foo</scope>
<name>operator&lt;&lt;</name>
</member>
<member refid="struct_foo_1a48bcc3de9b2f1ad09a3518a0c9f0da61" prot="public" virt="non-virtual">
<scope>Foo</scope>
<name>operator&lt;&lt;</name>
</member>
</listofallmembers>
</compounddef>
</doxygen>
49 changes: 49 additions & 0 deletions testing/074_ref.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// objective: test \ref command in combination with const
// check: struct_foo.xml
/** @brief Foo class.
*
* @see @ref Foo::Foo() constructor for details.
* @see @ref Foo constant.
* @see @ref operator<<(int) "less than operator".
* @see @ref operator<<(int) const "const less than operator".
* @see @ref operator()(int) "call operator".
* @see @ref operator()(int) const "const call operator".
* @see @ref operator&=(const Foo&) "and equal operator".
* @see @ref operator->*(int *) "member pointer operator".
*/
struct Foo {
/** Constructor */
Foo();
/**
* @brief Fun of two
*
* - fun() const
* - @ref fun() const
* - @ref fun() const "title"
*/
static Foo fun(Foo a, Foo b);

/** overloaded less than operator */
Foo& operator<< (int i);

/** overloaded const less than operator */
const Foo& operator<< (int i) const;

/** overloaded call operator */
int operator()(int i);

/** overloaded call operator */
int operator()(int i) const;

/** and equal operator */
Foo& operator&=(const Foo& rhs);

/** and equal operator */
Foo& operator&=(const Foo& rhs);

/** Member pointer operator */
int* operator->*(int *p);

/** @brief Fun with itself */
Foo fun() const;
};

0 comments on commit 2b42578

Please sign in to comment.