summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-11-16 15:48:55 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-11-16 15:48:55 (GMT)
commit9f477b87fc492221e1b7109d197fe468cd0ed23d (patch)
tree803388c3939e17874cfb16f0aaa94d178324324e
parentad5dfc39bee7a1b3de16f36bc3a20565aa6438fe (diff)
downloadDoxygen-9f477b87fc492221e1b7109d197fe468cd0ed23d.zip
Doxygen-9f477b87fc492221e1b7109d197fe468cd0ed23d.tar.gz
Doxygen-9f477b87fc492221e1b7109d197fe468cd0ed23d.tar.bz2
Bug 739214 - Cannot make unscoped link to C++ conversion operator
-rw-r--r--src/doctokenizer.l4
-rw-r--r--testing/064/struct_foo.xml112
-rw-r--r--testing/064_castoperator.cpp25
3 files changed, 140 insertions, 1 deletions
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 827b4fb..2de04a3 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -377,6 +377,7 @@ OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+
OPCAST {BLANK}+[^<(\r\n.,][^(\r\n.,]*
OPMASK ({BLANK}*{OPNORM}{FUNCARG})
OPMASKOPT ({BLANK}*{OPNORM}{FUNCARG}?)|({OPCAST}{FUNCARG})
+OPMASKOP2 ({BLANK}*{OPNORM}{FUNCARG2}?)|({OPCAST}{FUNCARG2})
LNKWORD1 ("::"|"#")?{SCOPEMASK}
CVSPEC {BLANK}*("const"|"volatile")
LNKWORD2 (({SCOPEPRE}*"operator"{OPMASK})|({SCOPEPRE}"operator"{OPMASKOPT})|(("::"|"#"){SCOPEPRE}*"operator"{OPMASKOPT})){CVSPEC}?
@@ -393,7 +394,8 @@ HTMLKEYU "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"
HTMLKEYW {HTMLKEYL}|{HTMLKEYU}
REFWORD2 ("#"|"::")?((({ID}{TEMPLPART}?)|{ANONNS})("."|"#"|"::"|"-"|"/"))*({ID}{TEMPLPART}?(":")?){FUNCARG2}?
REFWORD3 ({ID}":")*{ID}":"?
-REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{LNKWORD2}
+REFWORD4 (({SCOPEPRE}*"operator"{OPMASKOP2})|(("::"|"#"){SCOPEPRE}*"operator"{OPMASKOP2})){CVSPEC}?
+REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4}
%option noyywrap
%option yylineno
diff --git a/testing/064/struct_foo.xml b/testing/064/struct_foo.xml
new file mode 100644
index 0000000..3765625
--- /dev/null
+++ b/testing/064/struct_foo.xml
@@ -0,0 +1,112 @@
+<?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_1aab9774d892b6cd4a0fbebd034b4c1fad" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
+ <type/>
+ <definition>Foo::operator int</definition>
+ <argsstring>()</argsstring>
+ <name>operator int</name>
+ <briefdescription>
+ <para>Conversion to int. </para>
+ </briefdescription>
+ <detaileddescription>
+ </detaileddescription>
+ <inbodydescription>
+ </inbodydescription>
+ <location file="064_castoperator.cpp" line="22" column="1"/>
+ </memberdef>
+ <memberdef kind="function" id="struct_foo_1a870f369cc7af9489418451e78d8bd539" prot="public" static="no" const="yes" explicit="no" inline="no" virt="non-virtual">
+ <type/>
+ <definition>Foo::operator int</definition>
+ <argsstring>() const </argsstring>
+ <name>operator int</name>
+ <briefdescription>
+ <para>Conversion to int const. </para>
+ </briefdescription>
+ <detaileddescription>
+ </detaileddescription>
+ <inbodydescription>
+ </inbodydescription>
+ <location file="064_castoperator.cpp" line="24" column="1"/>
+ </memberdef>
+ </sectiondef>
+ <briefdescription>
+ <para><ref refid="struct_foo" kindref="compound">Foo</ref>. </para>
+ </briefdescription>
+ <detaileddescription>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>No autolink for operator int()</para>
+ </listitem>
+ <listitem>
+ <para>
+ <ref refid="struct_foo_1aab9774d892b6cd4a0fbebd034b4c1fad" kindref="member">operator int()</ref>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ref refid="struct_foo_1aab9774d892b6cd4a0fbebd034b4c1fad" kindref="member">title</ref>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ref refid="struct_foo_1aab9774d892b6cd4a0fbebd034b4c1fad" kindref="member">Foo::operator int()</ref>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ref refid="struct_foo_1aab9774d892b6cd4a0fbebd034b4c1fad" kindref="member">Foo::operator int()</ref>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ref refid="struct_foo_1aab9774d892b6cd4a0fbebd034b4c1fad" kindref="member">title</ref>
+ </para>
+ </listitem>
+ <listitem>
+ <para>No autolink for operator int() const</para>
+ </listitem>
+ <listitem>
+ <para>
+ <ref refid="struct_foo_1a870f369cc7af9489418451e78d8bd539" kindref="member">operator int() const</ref>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ref refid="struct_foo_1a870f369cc7af9489418451e78d8bd539" kindref="member">title</ref>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ref refid="struct_foo_1a870f369cc7af9489418451e78d8bd539" kindref="member">Foo::operator int() const</ref>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ref refid="struct_foo_1a870f369cc7af9489418451e78d8bd539" kindref="member">Foo::operator int() const</ref>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ref refid="struct_foo_1a870f369cc7af9489418451e78d8bd539" kindref="member">title</ref>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </detaileddescription>
+ <location file="064_castoperator.cpp" bodystart="20" bodyend="25"/>
+ <listofallmembers>
+ <member refid="struct_foo_1aab9774d892b6cd4a0fbebd034b4c1fad" prot="public" virt="non-virtual">
+ <scope>Foo</scope>
+ <name>operator int</name>
+ </member>
+ <member refid="struct_foo_1a870f369cc7af9489418451e78d8bd539" prot="public" virt="non-virtual">
+ <scope>Foo</scope>
+ <name>operator int</name>
+ </member>
+ </listofallmembers>
+ </compounddef>
+</doxygen>
diff --git a/testing/064_castoperator.cpp b/testing/064_castoperator.cpp
new file mode 100644
index 0000000..d6f8006
--- /dev/null
+++ b/testing/064_castoperator.cpp
@@ -0,0 +1,25 @@
+// objective: test linking to the cast operator with and without const
+// check: struct_foo.xml
+/**
+ * @brief Foo
+ *
+ * - No autolink for operator int()
+ * - @ref operator int()
+ * - @ref operator int() "title"
+ * - Foo::operator int()
+ * - @ref Foo::operator int()
+ * - @ref Foo::operator int() "title"
+ *
+ * - No autolink for operator int() const
+ * - @ref operator int() const
+ * - @ref operator int() const "title"
+ * - Foo::operator int() const
+ * - @ref Foo::operator int() const
+ * - @ref Foo::operator int() const "title"
+ */
+struct Foo {
+ /** @brief Conversion to int */
+ operator int();
+ /** @brief Conversion to int const */
+ operator int() const;
+};