From 818f0458205a2965f0a676265e2454450a4c3455 Mon Sep 17 00:00:00 2001 From: Matthew White Date: Mon, 24 Jul 2017 10:02:35 +0200 Subject: Add variadic template function regression tests * testing/069_link_variadic_template.cpp: new file, @link regression test for variadic template function * testing/069/069__link__variadic__template_8cpp.xml: new file, expected @link regression test result for variadic template function * testing/070_ref_variadic_template.cpp: new file, @ref regression test for variadic template function * testing/070/070__ref__variadic__template_8cpp.xml: new file, expected @ref regression test result for variadic template function At the time of writing, the part between <> is totally ignored: func(Args... args) is interpreted as func(Args... args). Beware that a function parameter with either a & or * operator, e.g. 'const Args&... args', requires @link and @ref to use such parameter as verbatim, i.e. {@link func(const Args&... args)}. At the time of writing, the form {@link func(const Args&...)} will fail, unless the function parameter was declared just as 'const Args&...'. --- testing/069/069__link__variadic__template_8cpp.xml | 309 +++++++++++++++++++++ testing/069_link_variadic_template.cpp | 95 +++++++ testing/070/070__ref__variadic__template_8cpp.xml | 309 +++++++++++++++++++++ testing/070_ref_variadic_template.cpp | 95 +++++++ 4 files changed, 808 insertions(+) create mode 100644 testing/069/069__link__variadic__template_8cpp.xml create mode 100644 testing/069_link_variadic_template.cpp create mode 100644 testing/070/070__ref__variadic__template_8cpp.xml create mode 100644 testing/070_ref_variadic_template.cpp diff --git a/testing/069/069__link__variadic__template_8cpp.xml b/testing/069/069__link__variadic__template_8cpp.xml new file mode 100644 index 0000000..c93a732 --- /dev/null +++ b/testing/069/069__link__variadic__template_8cpp.xml @@ -0,0 +1,309 @@ + + + + 069_link_variadic_template.cpp + Test + + + void + void func + (int p) + func + + int + p + + + + + A function + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, Args &... args) + func + + int + p + + + Args &... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, Args &&... args) + func + + int + p + + + Args &&... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, const Args &... args) + func + + int + p + + + const Args &... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, const Args &&... args) + func + + int + p + + + const Args &&... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, Args *... args) + func + + int + p + + + Args *... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, Args **... args) + func + + int + p + + + Args **... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, const Args *... args) + func + + int + p + + + const Args *... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, const Args **... args) + func + + int + p + + + const Args **... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, Args... args) + func + + int + p + + + Args... + args + + + + + A variadic template function overload + + + + + + + + + + + + + + At the time of writing, the part between <> is totally ignored: func<Args...>(Args... args) is interpreted as func(Args... args). + Beware that a function parameter with either a & or * operator, e.g. 'const Args&... args', requires \link and \ref to specify such parameter as verbatim, i.e. 'const Args&... args'. At the time of writing, the form func(const Args&...) will fail, unless the function parameter was declared just as 'const Args&...'. + + + + + + variadic template method + + Links to the variadic template function overloads: First overloadSecond overloadThird overloadFourth overloadFifth overloadSixth overloadSeventh overloadEighth overloadNinth overload +The followings are interpreted the same: without template argumentwith template argument +See the test class. + + + + diff --git a/testing/069_link_variadic_template.cpp b/testing/069_link_variadic_template.cpp new file mode 100644 index 0000000..89ab57c --- /dev/null +++ b/testing/069_link_variadic_template.cpp @@ -0,0 +1,95 @@ +// objective: test \link command with a variadic template function +// check: 069__link__variadic__template_8cpp.xml + +/** \file + * + * @attention + * @parblock + * At the time of writing, the part between \<\> is totally ignored: + * %func(Args... args) is interpreted as %func(Args... args). + * + * Beware that a function parameter with either a \& or \* operator, + * e.g. 'const Args&... args', requires \\link and \\ref to specify + * such parameter as verbatim, i.e. 'const Args&... args'. At the + * time of writing, the form %func(const Args&...) will fail, unless + * the function parameter was declared just as 'const Args&...'. + * @endparblock + * + * \link Test::func(int,Args...)const variadic template method\endlink + * + * Links to the variadic template function overloads: + * @li \link func(int,Args&... args) First overload\endlink + * @li \link func(int,Args&&... args) Second overload\endlink + * @li \link func(int,const Args&... args) Third overload\endlink + * @li \link func(int,const Args&&... args) Fourth overload\endlink + * @li \link func(int,Args*... args) Fifth overload\endlink + * @li \link func(int,Args**... args) Sixth overload\endlink + * @li \link func(int,const Args*... args) Seventh overload\endlink + * @li \link func(int,const Args**... args) Eighth overload\endlink + * @li \link func(int,Args...) Ninth overload\endlink + * + * The followings are interpreted the same: + * @li \link func(int,const Args&... args) without template argument\endlink + * @li \link func(int,const Args&... args) with template argument\endlink + * + * See the \link Test test\endlink class. + */ + +/** A function + */ +void func(int p); + +/** A variadic template function overload + */ +template +void func(int p, Args&... args); + +/** A variadic template function overload + */ +template +void func(int p, Args&&... args); + +/** A variadic template function overload + */ +template +void func(int p, const Args&... args); + +/** A variadic template function overload + */ +template +void func(int p, const Args&&... args); + +/** A variadic template function overload + */ +template +void func(int p, Args*... args); + +/** A variadic template function overload + */ +template +void func(int p, Args**... args); + +/** A variadic template function overload + */ +template +void func(int p, const Args*... args); + +/** A variadic template function overload + */ +template +void func(int p, const Args**... args); + +/** A variadic template function overload + */ +template +void func(int p, Args... args); + +/** A test */ +class Test +{ + public: + /** A variadic template method + */ + template + void func(int p, Args... args) const; +}; diff --git a/testing/070/070__ref__variadic__template_8cpp.xml b/testing/070/070__ref__variadic__template_8cpp.xml new file mode 100644 index 0000000..0f581e5 --- /dev/null +++ b/testing/070/070__ref__variadic__template_8cpp.xml @@ -0,0 +1,309 @@ + + + + 070_ref_variadic_template.cpp + Test + + + void + void func + (int p) + func + + int + p + + + + + A function + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, Args &... args) + func + + int + p + + + Args &... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, Args &&... args) + func + + int + p + + + Args &&... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, const Args &... args) + func + + int + p + + + const Args &... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, const Args &&... args) + func + + int + p + + + const Args &&... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, Args *... args) + func + + int + p + + + Args *... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, Args **... args) + func + + int + p + + + Args **... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, const Args *... args) + func + + int + p + + + const Args *... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, const Args **... args) + func + + int + p + + + const Args **... + args + + + + + A variadic template function overload + + + + + + + + + typename... + Args + Args + + + void + void func + (int p, Args... args) + func + + int + p + + + Args... + args + + + + + A variadic template function overload + + + + + + + + + + + + + + At the time of writing, the part between <> is totally ignored: func<Args...>(Args... args) is interpreted as func(Args... args). + Beware that a function parameter with either a & or * operator, e.g. 'const Args&... args', requires \link and \ref to specify such parameter as verbatim, i.e. 'const Args&... args'. At the time of writing, the form func(const Args&...) will fail, unless the function parameter was declared just as 'const Args&...'. + + + + + + variadic template method + + References to the variadic template function overloads: First overloadSecond overloadThird overloadFourth overloadFifth overloadSixth overloadSeventh overloadEighth overloadNinth overload +The followings are interpreted the same: without template argumentwith template argument +See the test class. + + + + diff --git a/testing/070_ref_variadic_template.cpp b/testing/070_ref_variadic_template.cpp new file mode 100644 index 0000000..376cebe --- /dev/null +++ b/testing/070_ref_variadic_template.cpp @@ -0,0 +1,95 @@ +// objective: test \ref command with a variadic template function +// check: 070__ref__variadic__template_8cpp.xml + +/** \file + * + * @attention + * @parblock + * At the time of writing, the part between \<\> is totally ignored: + * %func(Args... args) is interpreted as %func(Args... args). + * + * Beware that a function parameter with either a \& or \* operator, + * e.g. 'const Args&... args', requires \\link and \\ref to specify + * such parameter as verbatim, i.e. 'const Args&... args'. At the + * time of writing, the form %func(const Args&...) will fail, unless + * the function parameter was declared just as 'const Args&...'. + * @endparblock + * + * \ref Test::func(int,Args...)const "variadic template method" + * + * References to the variadic template function overloads: + * @li \ref func(int,Args&... args) "First overload" + * @li \ref func(int,Args&&... args) "Second overload" + * @li \ref func(int,const Args&... args) "Third overload" + * @li \ref func(int,const Args&&... args) "Fourth overload" + * @li \ref func(int,Args*... args) "Fifth overload" + * @li \ref func(int,Args**... args) "Sixth overload" + * @li \ref func(int,const Args*... args) "Seventh overload" + * @li \ref func(int,const Args**... args) "Eighth overload" + * @li \ref func(int,Args...) "Ninth overload" + * + * The followings are interpreted the same: + * @li \ref func(int,const Args&... args) "without template argument" + * @li \ref func(int,const Args&... args) "with template argument" + * + * See the \ref Test "test" class. + */ + +/** A function + */ +void func(int p); + +/** A variadic template function overload + */ +template +void func(int p, Args&... args); + +/** A variadic template function overload + */ +template +void func(int p, Args&&... args); + +/** A variadic template function overload + */ +template +void func(int p, const Args&... args); + +/** A variadic template function overload + */ +template +void func(int p, const Args&&... args); + +/** A variadic template function overload + */ +template +void func(int p, Args*... args); + +/** A variadic template function overload + */ +template +void func(int p, Args**... args); + +/** A variadic template function overload + */ +template +void func(int p, const Args*... args); + +/** A variadic template function overload + */ +template +void func(int p, const Args**... args); + +/** A variadic template function overload + */ +template +void func(int p, Args... args); + +/** A test */ +class Test +{ + public: + /** A variadic template method + */ + template + void func(int p, Args... args) const; +}; -- cgit v0.12