From 9f477b87fc492221e1b7109d197fe468cd0ed23d Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 16 Nov 2014 16:48:55 +0100 Subject: [PATCH] Bug 739214 - Cannot make unscoped link to C++ conversion operator --- src/doctokenizer.l | 4 +- testing/064/struct_foo.xml | 112 +++++++++++++++++++++++++++++++++++ testing/064_castoperator.cpp | 25 ++++++++ 3 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 testing/064/struct_foo.xml create mode 100644 testing/064_castoperator.cpp diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 827b4fbd924..2de04a3cc98 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 00000000000..3765625de95 --- /dev/null +++ b/testing/064/struct_foo.xml @@ -0,0 +1,112 @@ + + + + Foo + + + + Foo::operator int + () + operator int + + Conversion to int. + + + + + + + + + + Foo::operator int + () const + operator int + + Conversion to int const. + + + + + + + + + + Foo. + + + + + + No autolink for operator int() + + + + operator int() + + + + + title + + + + + Foo::operator int() + + + + + Foo::operator int() + + + + + title + + + + No autolink for operator int() const + + + + operator int() const + + + + + title + + + + + Foo::operator int() const + + + + + Foo::operator int() const + + + + + title + + + + + + + + + Foo + operator int + + + Foo + operator int + + + + diff --git a/testing/064_castoperator.cpp b/testing/064_castoperator.cpp new file mode 100644 index 00000000000..d6f80067051 --- /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; +};