diff --git a/share/mrdocs/addons/generator/adoc/partials/symbol.adoc.hbs b/share/mrdocs/addons/generator/adoc/partials/symbol.adoc.hbs index c8b6efea89..d5446173e9 100644 --- a/share/mrdocs/addons/generator/adoc/partials/symbol.adoc.hbs +++ b/share/mrdocs/addons/generator/adoc/partials/symbol.adoc.hbs @@ -48,6 +48,7 @@ {{! Enum members }} {{else if (eq symbol.kind "enum")}} +{{#if symbol.constants}} {{#> markup/dynamic-level-h }}Members{{/markup/dynamic-level-h}} [,cols=2] @@ -63,6 +64,7 @@ {{/each}} |=== +{{/if}} {{/if}} {{! Using directives }} {{#if symbol.usingDirectives}} diff --git a/src/lib/AST/ParseRef.cpp b/src/lib/AST/ParseRef.cpp index a9dc91d07b..fcb5174f7b 100644 --- a/src/lib/AST/ParseRef.cpp +++ b/src/lib/AST/ParseRef.cpp @@ -1988,7 +1988,8 @@ class RefParser // https://en.cppreference.com/w/cpp/language/function char const* start = ptr_; - if (auto* destMF = dynamic_cast(&dest)) + auto* destMF = dynamic_cast(&dest); + if (destMF && !destMF->IsExplicitObjectMemberFunction) { // Parse cv: // const/volatile qualification, only allowed in non-static member @@ -2004,7 +2005,7 @@ class RefParser // Parse ref: // ref-qualification, only allowed in non-static member function // declarations - if (auto* destMF = dynamic_cast(&dest)) + if (destMF && !destMF->IsExplicitObjectMemberFunction) { skipWhitespace(); if (parseLiteral("&")) diff --git a/src/lib/Lib/CorpusImpl.cpp b/src/lib/Lib/CorpusImpl.cpp index 95f95f9251..158654f95f 100644 --- a/src/lib/Lib/CorpusImpl.cpp +++ b/src/lib/Lib/CorpusImpl.cpp @@ -129,51 +129,120 @@ findFirstParentInfo( } } +template bool -isDecayedEqual( +isDecayedEqualImpl( Polymorphic const& lhs, Polymorphic const& rhs) { - // When comparing two parameters, we need to compare - // them as if they are decayed at the top level - // the same way function parameters are decayed to - // consider if they redefine an overload. - if (lhs == rhs) + // Polymorphic + MRDOCS_CHECK_OR(static_cast(lhs) == static_cast(rhs), false); + MRDOCS_CHECK_OR(static_cast(lhs) && static_cast(rhs), true); + // TypeInfo + bool const decayToPointer = !isInner && (lhs->isArray() || rhs->isArray()); + if (!decayToPointer) + { + MRDOCS_CHECK_OR(lhs->Kind == rhs->Kind, false); + } + else { - return true; + // in root types, arrays are decayed to pointers + MRDOCS_CHECK_OR(lhs->isArray() || lhs->isPointer(), false); + MRDOCS_CHECK_OR(rhs->isArray() || rhs->isPointer(), false); } - - // const and volatile are ignored at the top level - auto lhsDecay = lhs; - lhsDecay->IsConst = false; - lhsDecay->IsVolatile = false; - auto rhsDecay = rhs; - rhsDecay->IsConst = false; - rhsDecay->IsVolatile = false; - - // Arrays decay to pointer - if (lhsDecay->isArray()) + MRDOCS_CHECK_OR(lhs->IsPackExpansion == rhs->IsPackExpansion, false); + if constexpr (isInner) + { + // const and volative are ignored from root types + // in function parameters + MRDOCS_CHECK_OR(lhs->IsConst == rhs->IsConst, false); + MRDOCS_CHECK_OR(lhs->IsVolatile == rhs->IsVolatile, false); + } + MRDOCS_CHECK_OR(lhs->Constraints == rhs->Constraints, false); + switch (lhs->Kind) + { + // Types that never decay are compared directly + case TypeKind::Named: + { + // Compare only the fields of NameInfo, without + // TypeInfo, to avoid evaluating TypeInfo::IsConst + return dynamic_cast(*lhs).Name == + dynamic_cast(*rhs).Name; + } + case TypeKind::Decltype: + { + return dynamic_cast(*lhs).Operand == + dynamic_cast(*rhs).Operand; + } + case TypeKind::Auto: + { + auto const& lhsAuto = dynamic_cast(*lhs); + auto const& rhsAuto = dynamic_cast(*rhs); + return lhsAuto.Keyword == rhsAuto.Keyword && + lhsAuto.Constraint == rhsAuto.Constraint; + } + case TypeKind::LValueReference: { - auto& lhsAsArray = dynamic_cast(*lhsDecay); - PointerTypeInfo lhsAsPtr; - lhsAsPtr.PointeeType = std::move(lhsAsArray.ElementType); - // Copy all fields from base type - dynamic_cast(lhsAsPtr) = dynamic_cast(lhsAsArray); - lhsAsPtr.Kind = TypeKind::Pointer; - lhsDecay = std::move(lhsAsPtr); + return + isDecayedEqualImpl( + dynamic_cast(*lhs).PointeeType, + dynamic_cast(*rhs).PointeeType); } - if (rhsDecay->isArray()) + case TypeKind::RValueReference: { - auto& rhsAsArray = dynamic_cast(*rhsDecay); - PointerTypeInfo rhsAsPtr; - rhsAsPtr.PointeeType = std::move(rhsAsArray.ElementType); - // Copy all fields from base type - dynamic_cast(rhsAsPtr) = dynamic_cast(rhsAsArray); - rhsAsPtr.Kind = TypeKind::Pointer; - rhsDecay = std::move(rhsAsPtr); + return + isDecayedEqualImpl( + dynamic_cast(*lhs).PointeeType, + dynamic_cast(*rhs).PointeeType); } + case TypeKind::MemberPointer: + { + auto const& lhsMP = dynamic_cast(*lhs); + auto const& rhsMP = dynamic_cast(*rhs); + return + isDecayedEqualImpl(lhsMP.PointeeType, rhsMP.PointeeType) && + isDecayedEqualImpl(lhsMP.ParentType, rhsMP.ParentType); + } + case TypeKind::Function: + { + auto const& lhsF = dynamic_cast(*lhs); + auto const& rhsF = dynamic_cast(*rhs); + MRDOCS_CHECK_OR(lhsF.RefQualifier == rhsF.RefQualifier, false); + MRDOCS_CHECK_OR(lhsF.ExceptionSpec == rhsF.ExceptionSpec, false); + MRDOCS_CHECK_OR(lhsF.IsVariadic == rhsF.IsVariadic, false); + MRDOCS_CHECK_OR(isDecayedEqualImpl(lhsF.ReturnType, rhsF.ReturnType), false); + MRDOCS_CHECK_OR(lhsF.ParamTypes.size() == rhsF.ParamTypes.size(), false); + for (std::size_t i = 0; i < lhsF.ParamTypes.size(); ++i) + { + MRDOCS_CHECK_OR(isDecayedEqualImpl(lhsF.ParamTypes[i], rhsF.ParamTypes[i]), false); + } + return true; + } + // Types that should decay + case TypeKind::Pointer: + case TypeKind::Array: + { + auto const I1 = innerType(*lhs); + auto const I2 = innerType(*rhs); + MRDOCS_CHECK_OR(static_cast(I1) == static_cast(I2), false); + MRDOCS_CHECK_OR(static_cast(I1) && static_cast(I2), true); + return isDecayedEqualImpl(I1->get(), I2->get()); + } + default: + MRDOCS_UNREACHABLE(); + } + return true; +} - return lhsDecay == rhsDecay; +/* Compare two types for equality for the purposes of + overload resolution. + */ +bool +isDecayedEqual( + Polymorphic const& lhs, + Polymorphic const& rhs) +{ + return isDecayedEqualImpl(lhs, rhs); } } diff --git a/test-files/golden-tests/javadoc/copydoc/param-types.adoc b/test-files/golden-tests/javadoc/copydoc/param-types.adoc new file mode 100644 index 0000000000..cf1d8d3312 --- /dev/null +++ b/test-files/golden-tests/javadoc/copydoc/param-types.adoc @@ -0,0 +1,1082 @@ += Reference +:mrdocs: + +[#index] +== Global namespace + + +=== Namespaces + +[cols=2] +|=== +| Name +| Description + +| <> +| Namespace to test qualified identifier parameters. + +|=== +=== Types + +[cols=2] +|=== +| Name +| Description + +| <> +| Struct to test explicit object member functions. + +| <> +| Struct used to vary the parameter type. + +|=== +=== Enums + +[cols=1] +|=== +| Name + +| <> + +|=== +=== Functions + +[cols=2] +|=== +| Name +| Description + +| <> +| `f` overloads + +| <> +| `g` overloads + +|=== + +[#N] +== N + + +Namespace to test qualified identifier parameters. + +=== Namespaces + +[cols=2] +|=== +| Name +| Description + +| <> +| Namespace to test qualified identifier parameters. + +|=== + +[#N-M] +== <>::M + + +Namespace to test qualified identifier parameters. + +=== Types + +[cols=2] +|=== +| Name +| Description + +| <> +| Struct to test qualified identifier parameters. + +|=== + +[#N-M-Q] +== <>::<>::Q + + +Struct to test qualified identifier parameters. + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct Q; +---- + + + + +[#A] +== A + + +Struct to test explicit object member functions. + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct A; +---- + +=== Member Functions + +[cols=2] +|=== +| Name +| Description + +| <> +| Reference member function. + +| <> +| Reference member function. + +|=== + + + +[#A-f] +== <>::f + + +Reference member function. + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(<><4> a); +---- + +=== Description + + +Documentation for a function with an explicit object parameter. + +This reference uses the `this` keyword. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#A-g] +== <>::g + + +Reference member function. + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +g(this + <>& self, + int a); +---- + +=== Description + + +Documentation for a function with an explicit object parameter. + + + +=== Parameters + + +|=== +| Name | Description + +| *self* +| The object to operate on + +| *a* +| The first parameter of g + +|=== + +[#paramType] +== paramType + + +Struct used to vary the parameter type. + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<int Idx> +struct paramType; +---- + + + + +[#testEnum] +== testEnum + + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +enum testEnum; +---- + +[#f-0e] +== f + + +`f` overloads + +=== Synopses + + +Declared in `<param‐types.cpp>` + +Reference function. + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(); +---- + +[.small]#<># + +Reference function. + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<><0> a); +---- + +[.small]#<># + +Reference function. + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<><1> a); +---- + +[.small]#<># + +Variadic function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<><2> a); +---- + +[.small]#<># + +Non‐variadic function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<><3> a); +---- + +[.small]#<># + +struct param function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<><5> a); +---- + +[.small]#<># + +Decltype function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<><6> a); +---- + +[.small]#<># + +struct param function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<><7> a); +---- + +[.small]#<># + +Enum param function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<><8> a); +---- + +[.small]#<># + +Qualified identifier param function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<><9> a); +---- + +[.small]#<># + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of f + +|=== + +[#f-0b3] +== f + + +Reference function. + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(); +---- + +=== Description + + +Documentation for the reference function. + + + +[#f-00] +== f + + +Reference function. + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(<><0> a); +---- + +=== Description + + +Documentation for the reference function. + +This function uses a reference with no parameters. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of f + +|=== + +[#f-08c] +== f + + +Reference function. + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(<><1> a); +---- + +=== Description + + +Documentation for the reference function. + +This reference uses the `void` keyword. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of f + +|=== + +[#f-012] +== f + + +Variadic function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(<><2> a); +---- + +=== Description + + +Documentation for the variadic function. + +This reference uses the `...` keyword. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#f-0c] +== f + + +Non‐variadic function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(<><3> a); +---- + +=== Description + + +Documentation for the non‐variadic function. + +This reference uses the `int` keyword. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#f-03] +== f + + +struct param function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(<><5> a); +---- + +=== Description + + +Documentation for a function with a struct parameter. + +This reference uses the `auto` keyword. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#f-04] +== f + + +Decltype function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(<><6> a); +---- + +=== Description + + +Documentation for a function with a `decltype` parameter. + +This reference uses the `decltype` keyword. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#f-0b5] +== f + + +struct param function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(<><7> a); +---- + +=== Description + + +Documentation for a function with a struct parameter. + +This reference uses the `struct` keyword. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#f-010] +== f + + +Enum param function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(<><8> a); +---- + +=== Description + + +Documentation for a function with an enum parameter. + +This reference uses the `enum` keyword. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#f-081] +== f + + +Qualified identifier param function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(<><9> a); +---- + +=== Description + + +Documentation for a function with a qualified identifier parameter. + +This reference uses the qualified identifier `N::M::Q`. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#g-0d] +== g + + +`g` overloads + +=== Synopses + + +Declared in `<param‐types.cpp>` + +struct param function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<> a); +---- + +[.small]#<># + +Qualified identifier param function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<>::<>::<> a); +---- + +[.small]#<># + +Variadic function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(int a, ...); +---- + +[.small]#<># + +Non‐variadic function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(int a); +---- + +[.small]#<># + +Enum param function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(<> a); +---- + +[.small]#<># + + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class a:auto> +void +<>(auto a); +---- + +[.small]#<># + +Decltype function + + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>( + int a, + decltype(a) b); +---- + +[.small]#<># + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +| *b* +| The second parameter of g + +|=== + +[#g-05] +== g + + +struct param function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +g(<> a); +---- + +=== Description + + +Documentation for a function with a struct parameter. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#g-09c] +== g + + +Qualified identifier param function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +g(<>::<>::<> a); +---- + +=== Description + + +Documentation for a function with a qualified identifier parameter. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#g-096] +== g + + +Variadic function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +g(int a, ...); +---- + +=== Description + + +Documentation for the variadic function. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#g-04a] +== g + + +Non‐variadic function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +g(int a); +---- + +=== Description + + +Documentation for the non‐variadic function. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#g-04c] +== g + + +Enum param function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +g(<> a); +---- + +=== Description + + +Documentation for a function with an enum parameter. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +|=== + +[#g-0b] +== g + + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class a:auto> +void +g(auto a); +---- + +[#g-0c] +== g + + +Decltype function + +=== Synopsis + + +Declared in `<param‐types.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +g( + int a, + decltype(a) b); +---- + +=== Description + + +Documentation for a function with a `decltype` parameter. + + + +=== Parameters + + +|=== +| Name | Description + +| *a* +| The first parameter of g + +| *b* +| The second parameter of g + +|=== + + + +[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/javadoc/copydoc/param-types.cpp b/test-files/golden-tests/javadoc/copydoc/param-types.cpp new file mode 100644 index 0000000000..9651a6c43a --- /dev/null +++ b/test-files/golden-tests/javadoc/copydoc/param-types.cpp @@ -0,0 +1,174 @@ +/// Struct used to vary the parameter type. +template +struct paramType {}; + +/** Reference function. + + Documentation for the reference function. + */ +void +f(); + +/** @copydoc f() + + This function uses a reference with no + parameters. + + @param a The first parameter of f + */ +void +f(paramType<0> a); + +/** @copydoc f(void) + + This reference uses the `void` keyword. + + @param a The first parameter of f + */ +void +f(paramType<1> a); + +/** Variadic function + + Documentation for the variadic function. + + @param a The first parameter of g + */ +void +g(int a, ...); + +/** Non-variadic function + + Documentation for the non-variadic function. + + @param a The first parameter of g + */ +void +g(int a); + +/** @copydoc g(int a, ...) + + This reference uses the `...` keyword. + */ +void +f(paramType<2> a); + +/** @copydoc g(int a) + + This reference uses the `int` keyword. + */ +void +f(paramType<3> a); + +/// Struct to test explicit object member functions. +struct A { + /** Reference member function. + + Documentation for a function with an + explicit object parameter. + + @param self The object to operate on + @param a The first parameter of g + */ + void + g(this A& self, int a); + + /** @copydoc g(this A& self, int a) + + This reference uses the `this` keyword. + */ + void + f(paramType<4> a); +}; + +/** Auto function + + Documentation for a function with an `auto` parameter. + + @param a The first parameter of g + */ +void +g(auto a); + +/** @copydoc g(auto a) + + This reference uses the `auto` keyword. + */ +void +f(paramType<5> a); + +/** Decltype function + + Documentation for a function with a `decltype` parameter. + + @param a The first parameter of g + @param b The second parameter of g + */ +void +g(int a, decltype(a) b); + +/** @copydoc g(int a, decltype(a) b) + + This reference uses the `decltype` keyword. + */ +void +f(paramType<6> a); + +/** struct param function + + Documentation for a function with a struct parameter. + + @param a The first parameter of g + */ +void +g(struct A a); + +/** @copydoc g(struct A a) + + This reference uses the `struct` keyword. + */ +void +f(paramType<7> a); + +enum testEnum {}; + +/** Enum param function + + Documentation for a function with an enum parameter. + + @param a The first parameter of g + */ +void +g(enum testEnum a); + +/** @copydoc g(enum testEnum a) + + This reference uses the `enum` keyword. + */ +void +f(paramType<8> a); + +/// Namespace to test qualified identifier parameters. +namespace N { + /// Namespace to test qualified identifier parameters. + namespace M { + /// Struct to test qualified identifier parameters. + struct Q {}; + } +} + +/** Qualified identifier param function + + Documentation for a function with a qualified identifier parameter. + + @param a The first parameter of g + */ +void +g(N::M::Q a); + +/** @copydoc g(N::M::Q a) + + This reference uses the qualified identifier `N::M::Q`. + */ +void +f(paramType<9> a); diff --git a/test-files/golden-tests/javadoc/copydoc/param-types.html b/test-files/golden-tests/javadoc/copydoc/param-types.html new file mode 100644 index 0000000000..857465f777 --- /dev/null +++ b/test-files/golden-tests/javadoc/copydoc/param-types.html @@ -0,0 +1,1372 @@ + + +Reference + + +
+

Reference

+
+
+

Global namespace

+
+

Namespaces

+ + + + + + + + + + + + +
NameDescription
N Namespace to test qualified identifier parameters. +
+

Types

+ + + + + + + + + + + + + + +
NameDescription
A Struct to test explicit object member functions. +
paramType Struct used to vary the parameter type. +
+

Enums

+ + + + + + + + + + + +
Name
testEnum
+

Functions

+ + + + + + + + + + + + + + +
NameDescription
f f overloads +
g g overloads +
+
+
+
+

N

+
+Namespace to test qualified identifier parameters. + + +
+
+

Namespaces

+ + + + + + + + + + + + +
NameDescription
M Namespace to test qualified identifier parameters. +
+
+
+
+

N::M

+
+Namespace to test qualified identifier parameters. + + +
+
+

Types

+ + + + + + + + + + + + +
NameDescription
Q Struct to test qualified identifier parameters. +
+
+
+
+

N::M::Q

+
+Struct to test qualified identifier parameters. + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+struct Q;
+
+
+
+ + +
+
+
+

A

+
+Struct to test explicit object member functions. + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+struct A;
+
+
+
+

Member Functions

+ + + + + + + + + + + + + + +
NameDescription
f Reference member function. +
g Reference member function. +
+ + +
+
+
+

A::f

+
+Reference member function. + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f(paramType<4> a);
+
+
+
+
+

Description

+

Documentation for a function with an explicit object parameter.

+

This reference uses the this keyword.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

A::g

+
+Reference member function. + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+g(this 
+    A& self,
+    int a);
+
+
+
+
+

Description

+

Documentation for a function with an explicit object parameter.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
NameDescription
self

The object to operate on

+
a

The first parameter of g

+
+
+
+
+
+

paramType

+
+Struct used to vary the parameter type. + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+template<int Idx>
+struct paramType;
+
+
+
+ + +
+
+
+

testEnum

+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+enum testEnum;
+
+
+
+
+

Members

+ + + + + + + + + +
NameDescription
+
+
+
+
+

f

+
+f overloads + + +
+
+
+

Synopses

+
+Declared in <param-types.cpp>
+

+ Reference function. + +

+ + +
+
+void
+f();
+
+
» more... + +

+ Reference function. + +

+ + +
+
+void
+f(paramType<0> a);
+
+
» more... + +

+ Reference function. + +

+ + +
+
+void
+f(paramType<1> a);
+
+
» more... + +

+ Variadic function + +

+ + +
+
+void
+f(paramType<2> a);
+
+
» more... + +

+ Non-variadic function + +

+ + +
+
+void
+f(paramType<3> a);
+
+
» more... + +

+ struct param function + +

+ + +
+
+void
+f(paramType<5> a);
+
+
» more... + +

+ Decltype function + +

+ + +
+
+void
+f(paramType<6> a);
+
+
» more... + +

+ struct param function + +

+ + +
+
+void
+f(paramType<7> a);
+
+
» more... + +

+ Enum param function + +

+ + +
+
+void
+f(paramType<8> a);
+
+
» more... + +

+ Qualified identifier param function + +

+ + +
+
+void
+f(paramType<9> a);
+
+
» more... + + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of f

+
+
+
+
+
+

f

+
+Reference function. + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f();
+
+
+
+
+

Description

+

Documentation for the reference function.

+ + +
+
+
+
+

f

+
+Reference function. + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f(paramType<0> a);
+
+
+
+
+

Description

+

Documentation for the reference function.

+

This function uses a reference with no parameters.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of f

+
+
+
+
+
+

f

+
+Reference function. + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f(paramType<1> a);
+
+
+
+
+

Description

+

Documentation for the reference function.

+

This reference uses the void keyword.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of f

+
+
+
+
+
+

f

+
+Variadic function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f(paramType<2> a);
+
+
+
+
+

Description

+

Documentation for the variadic function.

+

This reference uses the ... keyword.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

f

+
+Non-variadic function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f(paramType<3> a);
+
+
+
+
+

Description

+

Documentation for the non-variadic function.

+

This reference uses the int keyword.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

f

+
+struct param function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f(paramType<5> a);
+
+
+
+
+

Description

+

Documentation for a function with a struct parameter.

+

This reference uses the auto keyword.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

f

+
+Decltype function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f(paramType<6> a);
+
+
+
+
+

Description

+

Documentation for a function with a decltype parameter.

+

This reference uses the decltype keyword.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

f

+
+struct param function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f(paramType<7> a);
+
+
+
+
+

Description

+

Documentation for a function with a struct parameter.

+

This reference uses the struct keyword.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

f

+
+Enum param function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f(paramType<8> a);
+
+
+
+
+

Description

+

Documentation for a function with an enum parameter.

+

This reference uses the enum keyword.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

f

+
+Qualified identifier param function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+f(paramType<9> a);
+
+
+
+
+

Description

+

Documentation for a function with a qualified identifier parameter.

+

This reference uses the qualified identifier N::M::Q .

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

g

+
+g overloads + + +
+
+
+

Synopses

+
+Declared in <param-types.cpp>
+

+ struct param function + +

+ + +
+
+void
+g(A a);
+
+
» more... + +

+ Qualified identifier param function + +

+ + +
+
+void
+g(N::M::Q a);
+
+
» more... + +

+ Variadic function + +

+ + +
+
+void
+g(int a, ...);
+
+
» more... + +

+ Non-variadic function + +

+ + +
+
+void
+g(int a);
+
+
» more... + +

+ Enum param function + +

+ + +
+
+void
+g(testEnum a);
+
+
» more... + + + +
+
+template<class a:auto>
+void
+g(auto a);
+
+
» more... + +

+ Decltype function + +

+ + +
+
+void
+g(
+    int a,
+    decltype(a) b);
+
+
» more... + + +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
b

The second parameter of g

+
+
+
+
+
+

g

+
+struct param function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+g(A a);
+
+
+
+
+

Description

+

Documentation for a function with a struct parameter.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

g

+
+Qualified identifier param function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+g(N::M::Q a);
+
+
+
+
+

Description

+

Documentation for a function with a qualified identifier parameter.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

g

+
+Variadic function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+g(int a, ...);
+
+
+
+
+

Description

+

Documentation for the variadic function.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

g

+
+Non-variadic function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+g(int a);
+
+
+
+
+

Description

+

Documentation for the non-variadic function.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

g

+
+Enum param function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+g(testEnum a);
+
+
+
+
+

Description

+

Documentation for a function with an enum parameter.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+template<class a:auto>
+void
+g(auto a);
+
+
+
+
+
+
+

g

+
+Decltype function + + +
+
+
+

Synopsis

+
+Declared in <param-types.cpp>
+
+
+void
+g(
+    int a,
+    decltype(a) b);
+
+
+
+
+

Description

+

Documentation for a function with a decltype parameter.

+ + +
+
+

Parameters

+ + + + + + + + + + + + + + + + + +
NameDescription
a

The first parameter of g

+
b

The second parameter of g

+
+
+
+ +
+
+

Created with MrDocs

+
+ + \ No newline at end of file diff --git a/test-files/golden-tests/javadoc/copydoc/param-types.xml b/test-files/golden-tests/javadoc/copydoc/param-types.xml new file mode 100644 index 0000000000..d383c41910 --- /dev/null +++ b/test-files/golden-tests/javadoc/copydoc/param-types.xml @@ -0,0 +1,428 @@ + + + + + + + Namespace to test qualified identifier parameters. + + + + + + Namespace to test qualified identifier parameters. + + + + + + + Struct to test qualified identifier parameters. + + + + + + + + + + Struct to test explicit object member functions. + + + + + + + + + + Reference member function. + + + Documentation for a function with an explicit object parameter. + + + This reference uses the + this + keyword. + + + The first parameter of g + + + + + + + + + + + + + + + + + Reference member function. + + + Documentation for a function with an explicit object parameter. + + + The object to operate on + + + The first parameter of g + + + + + + + + + + + + + Reference function. + + + Documentation for the reference function. + + + + + + + + + + + Reference function. + + + Documentation for the reference function. + + + This function uses a reference with no parameters. + + + The first parameter of f + + + + + + + + + + + Reference function. + + + Documentation for the reference function. + + + This reference uses the + void + keyword. + + + The first parameter of f + + + + + + + + + + + Variadic function + + + Documentation for the variadic function. + + + This reference uses the + ... + keyword. + + + The first parameter of g + + + + + + + + + + + Non-variadic function + + + Documentation for the non-variadic function. + + + This reference uses the + int + keyword. + + + The first parameter of g + + + + + + + + + + + struct param function + + + Documentation for a function with a struct parameter. + + + This reference uses the + auto + keyword. + + + The first parameter of g + + + + + + + + + + + Decltype function + + + Documentation for a function with a + decltype + parameter. + + + This reference uses the + decltype + keyword. + + + The first parameter of g + + + + + + + + + + + struct param function + + + Documentation for a function with a struct parameter. + + + This reference uses the + struct + keyword. + + + The first parameter of g + + + + + + + + + + + Enum param function + + + Documentation for a function with an enum parameter. + + + This reference uses the + enum + keyword. + + + The first parameter of g + + + + + + + + + + + Qualified identifier param function + + + Documentation for a function with a qualified identifier parameter. + + + This reference uses the qualified identifier + N::M::Q + . + + + The first parameter of g + + + + + + + + + + + struct param function + + + Documentation for a function with a struct parameter. + + + The first parameter of g + + + + + + + + + + + Qualified identifier param function + + + Documentation for a function with a qualified identifier parameter. + + + The first parameter of g + + + + + + + + + + + + Variadic function + + + Documentation for the variadic function. + + + The first parameter of g + + + + + + + + + + + Non-variadic function + + + Documentation for the non-variadic function. + + + The first parameter of g + + + + + + + + + + + Enum param function + + + Documentation for a function with an enum parameter. + + + The first parameter of g + + + + + + + + + + + + + + + + Decltype function + + + Documentation for a function with a + decltype + parameter. + + + The first parameter of g + + + The second parameter of g + + + + +