diff --git a/docs/mrdocs.schema.json b/docs/mrdocs.schema.json index cfe9784819..8424e59b80 100644 --- a/docs/mrdocs.schema.json +++ b/docs/mrdocs.schema.json @@ -297,6 +297,66 @@ "title": "Detect and reduce SFINAE expressions", "type": "boolean" }, + "sort-members": { + "default": true, + "description": "When set to `true`, sort the members of a record or namespace by name and parameters. When set to `false`, the members are included in the declaration order they are extracted.", + "enum": [ + true, + false + ], + "title": "Sort the members of a record or namespace", + "type": "boolean" + }, + "sort-members-assignment-1st": { + "default": true, + "description": "When set to `true`, assignment operators are sorted first in the list of members of a record.", + "enum": [ + true, + false + ], + "title": "Sort assignment operators first", + "type": "boolean" + }, + "sort-members-conversion-last": { + "default": true, + "description": "When set to `true`, conversion operators are sorted last in the list of members of a record or namespace.", + "enum": [ + true, + false + ], + "title": "Sort conversion operators last", + "type": "boolean" + }, + "sort-members-ctors-1st": { + "default": true, + "description": "When set to `true`, constructors are sorted first in the list of members of a record.", + "enum": [ + true, + false + ], + "title": "Sort constructors first", + "type": "boolean" + }, + "sort-members-dtors-1st": { + "default": true, + "description": "When set to `true`, destructors are sorted first in the list of members of a record.", + "enum": [ + true, + false + ], + "title": "Sort destructors first", + "type": "boolean" + }, + "sort-members-relational-last": { + "default": true, + "description": "When set to `true`, relational operators are sorted last in the list of members of a record or namespace.", + "enum": [ + true, + false + ], + "title": "Sort relational operators last", + "type": "boolean" + }, "source-root": { "default": "", "description": "Path to the root directory of the source code. This path is used as a default for input files and a base for relative paths formed from absolute paths. This should typically be the root directory of the git project, as relative paths formed from it can be used to create links to these source files in the repository. Templates use the `base-url` option to create links to the source code.", diff --git a/include/mrdocs/ADT/PolymorphicValue.hpp b/include/mrdocs/ADT/Polymorphic.hpp similarity index 78% rename from include/mrdocs/ADT/PolymorphicValue.hpp rename to include/mrdocs/ADT/Polymorphic.hpp index 6bc99b5e97..b73ab0db03 100644 --- a/include/mrdocs/ADT/PolymorphicValue.hpp +++ b/include/mrdocs/ADT/Polymorphic.hpp @@ -9,25 +9,25 @@ // Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOCS_API_ADT_POLYMORPHICVALUE_HPP -#define MRDOCS_API_ADT_POLYMORPHICVALUE_HPP +#ifndef MRDOCS_API_ADT_POLYMORPHIC_HPP +#define MRDOCS_API_ADT_POLYMORPHIC_HPP -#include -#include -#include -#include -#include -#include #include +#include #include +#include +#include +#include +#include +#include namespace clang::mrdocs { -/** Default copier for PolymorphicValue. +/** Default copier for Polymorphic. This class template is used as the default copier for the class - template PolymorphicValue. + template Polymorphic. */ template struct DefaultDeleter @@ -40,11 +40,11 @@ struct DefaultDeleter } }; -/** Default copier for PolymorphicValue. +/** Default copier for Polymorphic. This class template is used as the default copier for the class - template PolymorphicValue. + template Polymorphic. */ template struct DefaultCopier @@ -65,27 +65,27 @@ struct DefaultCopier type `T` is not publicly derived from the type of the object being constructed. */ -class BadPolymorphicValueConstruction +class BadPolymorphicConstruction : public std::exception { public: - BadPolymorphicValueConstruction() noexcept = default; + BadPolymorphicConstruction() noexcept = default; char const* what() const noexcept override { return "bad polymorphic value construction"; } }; template -class PolymorphicValue; +class Polymorphic; template -struct IsPolymorphicValue : std::false_type {}; +struct IsPolymorphic : std::false_type {}; template -struct IsPolymorphicValue> : std::true_type {}; +struct IsPolymorphic> : std::true_type {}; template -inline constexpr bool IsPolymorphicValue_v = IsPolymorphicValue::value; +inline constexpr bool IsPolymorphic_v = IsPolymorphic::value; /** A polymorphic value-type. @@ -99,13 +99,13 @@ inline constexpr bool IsPolymorphicValue_v = IsPolymorphicValue::value; It also works like std::unique_ptr in the sense that it can be used to manage the lifetime of a polymorphic object. A - PolymorphicValue can be hold an object + Polymorphic can be hold an object of any class publicly derived from T - and copying the PolymorphicValue will + and copying the Polymorphic will copy the object of the derived class. This combination also allows for a - class that uses PolymorphicValue as + class that uses Polymorphic as a member to be copyable, movable, default constructible, default destructible, and comparable. @@ -152,11 +152,11 @@ inline constexpr bool IsPolymorphicValue_v = IsPolymorphicValue::value; useful for cheap default construction and for later assignment. - This implementation is inspired - by p0201r5. + This implementation is inspired by and + adapted from p0201r5 and p3019r11. */ template -class PolymorphicValue +class Polymorphic { // // Assertions @@ -179,7 +179,7 @@ class PolymorphicValue // Friends // template - friend class PolymorphicValue; + friend class Polymorphic; template < class BaseU, @@ -188,15 +188,15 @@ class PolymorphicValue requires std::constructible_from friend constexpr - PolymorphicValue - MakePolymorphicValue(Args&&... args); + Polymorphic + MakePolymorphic(Args&&... args); template requires std::derived_from friend constexpr - PolymorphicValue - DynamicCast(PolymorphicValue&& other); + Polymorphic + DynamicCast(Polymorphic&& other); public: using element_type = Base; @@ -206,18 +206,18 @@ class PolymorphicValue Ensures: *this is empty. */ constexpr - PolymorphicValue() noexcept = default; + Polymorphic() noexcept = default; - /** Constructs an empty PolymorphicValue. + /** Constructs an empty Polymorphic. Ensures: *this is empty. */ constexpr - PolymorphicValue(std::nullptr_t) noexcept {} + Polymorphic(std::nullptr_t) noexcept {} - /** Constructs a PolymorphicValue which owns an object of type V. + /** Constructs a Polymorphic which owns an object of type V. - Constructs a PolymorphicValue which owns an object of type V, + Constructs a Polymorphic which owns an object of type V, direct-non-list-initialized with std::forward(u), where V is remove_cvref_t. @@ -232,14 +232,14 @@ class PolymorphicValue @throws std::bad_alloc if required storage cannot be obtained. */ template Derived> - requires (!IsPolymorphicValue_v) + requires (!IsPolymorphic_v) explicit constexpr - PolymorphicValue(Derived&& other) - : PolymorphicValue( + Polymorphic(Derived&& other) + : Polymorphic( std::in_place_type>, std::forward(other)) {} - /** Constructs a PolymorphicValue which owns the object pointed to by p. + /** Constructs a Polymorphic which owns the object pointed to by p. If p is null, creates an empty object. If p is non-null creates an object that owns the object *p, with @@ -268,7 +268,7 @@ class PolymorphicValue @param d The deleter. @throws std::bad_alloc if required storage cannot be obtained. - @throws BadPolymorphicValueConstruction if + @throws BadPolymorphicConstruction if std::same_as>, std::same_as> and typeid(*p)!=typeid(U) are all true. */ @@ -285,7 +285,7 @@ class PolymorphicValue std::is_nothrow_move_constructible_v && std::is_nothrow_move_constructible_v explicit constexpr - PolymorphicValue(Derived* p, Copier c, Deleter d) + Polymorphic(Derived* p, Copier c, Deleter d) { // If p is null, creates an empty object. if (!p) @@ -298,7 +298,7 @@ class PolymorphicValue { if (typeid(*p) != typeid(Derived)) { - throw BadPolymorphicValueConstruction(); + throw BadPolymorphicConstruction(); } } @@ -308,7 +308,7 @@ class PolymorphicValue ptr_ = s_->ptr(); } - /// @copydoc PolymorphicValue(Derived*, Copier, Deleter) + /// @copydoc Polymorphic(Derived*, Copier, Deleter) template < std::derived_from Derived, class Copier = DefaultCopier> @@ -318,14 +318,14 @@ class PolymorphicValue std::destructible && std::is_nothrow_move_constructible_v explicit constexpr - PolymorphicValue(Derived* p, Copier c) - : PolymorphicValue(p, c, DefaultDeleter{}) {} + Polymorphic(Derived* p, Copier c) + : Polymorphic(p, c, DefaultDeleter{}) {} - /// @copydoc PolymorphicValue(Derived*, Copier, Deleter) + /// @copydoc Polymorphic(Derived*, Copier, Deleter) template Derived> explicit constexpr - PolymorphicValue(Derived* p) - : PolymorphicValue(p, DefaultCopier{}, DefaultDeleter{}) {} + Polymorphic(Derived* p) + : Polymorphic(p, DefaultCopier{}, DefaultDeleter{}) {} /** Copy constructor. @@ -347,12 +347,12 @@ class PolymorphicValue @post bool(*this) == bool(pv). - @param other The PolymorphicValue to copy from. + @param other The Polymorphic to copy from. @throws std::bad_alloc if required storage cannot be obtained. */ constexpr - PolymorphicValue(PolymorphicValue const& other) + Polymorphic(Polymorphic const& other) { if (!other) { @@ -385,14 +385,14 @@ class PolymorphicValue @post bool(*this) == bool(pv). - @param other The PolymorphicValue to copy from. + @param other The Polymorphic to copy from. @throws std::bad_alloc if required storage cannot be obtained. */ template Derived> requires (!std::same_as) explicit constexpr - PolymorphicValue(PolymorphicValue const& other) + Polymorphic(Polymorphic const& other) { if (!other) { @@ -416,10 +416,10 @@ class PolymorphicValue @post *this owns the object previously owned by pv (if any). pv is empty. - @param other The PolymorphicValue to move from. + @param other The Polymorphic to move from. */ constexpr - PolymorphicValue(PolymorphicValue&& other) noexcept + Polymorphic(Polymorphic&& other) noexcept { ptr_ = std::exchange(other.ptr_, nullptr); s_ = std::exchange(other.s_, nullptr); @@ -439,12 +439,12 @@ class PolymorphicValue @post *this owns the object previously owned by pv (if any). pv is empty. - @param other The PolymorphicValue to move from. + @param other The Polymorphic to move from. */ template Derived> requires (!std::same_as) explicit constexpr - PolymorphicValue(PolymorphicValue&& other) noexcept + Polymorphic(Polymorphic&& other) noexcept { if (!other) { @@ -461,10 +461,10 @@ class PolymorphicValue template requires std::derived_from, Base> && - (!IsPolymorphicValue_v>) && + (!IsPolymorphic_v>) && std::constructible_from explicit constexpr - PolymorphicValue( + Polymorphic( std::in_place_type_t, Args&&... args) : s_(new detail::DirectPolymorphicStorage(std::forward(args)...)) @@ -479,7 +479,7 @@ class PolymorphicValue Otherwise, destroys the owned object (if any). */ constexpr - ~PolymorphicValue() + ~Polymorphic() { delete s_; ptr_ = nullptr; @@ -488,7 +488,7 @@ class PolymorphicValue /** Copy assignment operator. - Equivalent to `PolymorphicValue(pv).swap(*this)`. + Equivalent to `Polymorphic(pv).swap(*this)`. No effects if an exception is thrown. @@ -496,14 +496,14 @@ class PolymorphicValue @post The state of *this is as if copy constructed from pv. - @param other The PolymorphicValue to copy from. + @param other The Polymorphic to copy from. @return Reference to *this. @throws std::bad_alloc if required storage cannot be obtained. */ constexpr - PolymorphicValue& - operator=(PolymorphicValue const& other) + Polymorphic& + operator=(Polymorphic const& other) { if (&other == this) { @@ -526,18 +526,18 @@ class PolymorphicValue /** Move assignment operator. - Equivalent to `PolymorphicValue(pv).swap(*this)`. + Equivalent to `Polymorphic(pv).swap(*this)`. @post The state of *this is as if copy constructed from pv. - @param other The PolymorphicValue to copy from. + @param other The Polymorphic to copy from. @return Reference to *this. @throws std::bad_alloc if required storage cannot be obtained. */ constexpr - PolymorphicValue& - operator=(PolymorphicValue&& other) noexcept + Polymorphic& + operator=(Polymorphic&& other) noexcept { if (&other == this) { @@ -553,12 +553,12 @@ class PolymorphicValue Assign directly from a derived object. - Equivalent to `PolymorphicValue(std::move(other)).swap(*this)`. + Equivalent to `Polymorphic(std::move(other)).swap(*this)`. This is an extension to the standard that extremely useful in MrDocs because it allows us to construct the object of the derived type - on the stack and then assign it to a PolymorphicValue + on the stack and then assign it to a Polymorphic member of a class. @post The state of *this is as if copy constructed from other. @@ -571,10 +571,10 @@ class PolymorphicValue template requires std::derived_from, Base> constexpr - PolymorphicValue& + Polymorphic& operator=(Derived&& other) noexcept { - *this = PolymorphicValue( + *this = Polymorphic( std::in_place_type>, std::forward(other)); return *this; @@ -582,11 +582,11 @@ class PolymorphicValue /** Exchanges the state of p and *this. - @param other The PolymorphicValue to swap with. + @param other The Polymorphic to swap with. */ constexpr void - swap(PolymorphicValue& other) noexcept + swap(Polymorphic& other) noexcept { using std::swap; swap(ptr_, other.ptr_); @@ -643,9 +643,9 @@ class PolymorphicValue return ptr_; } - /** Checks if the PolymorphicValue owns an object. + /** Checks if the Polymorphic owns an object. - @return true if the PolymorphicValue owns an object, otherwise false. + @return true if the Polymorphic owns an object, otherwise false. */ explicit operator @@ -655,13 +655,13 @@ class PolymorphicValue } }; -/** Creates a PolymorphicValue owning an object of type U. +/** Creates a Polymorphic owning an object of type U. - @tparam Base The type of the PolymorphicValue. + @tparam Base The type of the Polymorphic. @tparam Derived The type of the object to be owned, defaults to T. @tparam Args The types of the arguments to forward to the constructor of U. @param args The arguments to forward to the constructor of U. - @return A PolymorphicValue owning an object of type U direct-non-list-initialized with std::forward(ts)... + @return A Polymorphic owning an object of type U direct-non-list-initialized with std::forward(ts)... */ template < class Base, @@ -669,28 +669,28 @@ template < class... Args> requires std::constructible_from constexpr -PolymorphicValue -MakePolymorphicValue(Args&&... args) +Polymorphic +MakePolymorphic(Args&&... args) { - PolymorphicValue p; + Polymorphic p; using BCT = detail::DirectPolymorphicStorage; p.s_ = new BCT(std::forward(args)...); p.ptr_ = p.s_->ptr(); return p; } -/** Dynamically cast the object owned by a PolymorphicValue. +/** Dynamically cast the object owned by a Polymorphic. @tparam Derived The type to cast to. - @tparam Base The type of the PolymorphicValue. - @param other The PolymorphicValue to cast. + @tparam Base The type of the Polymorphic. + @param other The Polymorphic to cast. @return A pointer to the object owned by other cast to Derived, or nullptr if the cast fails. */ template requires std::derived_from constexpr -PolymorphicValue -DynamicCast(PolymorphicValue&& other) +Polymorphic +DynamicCast(Polymorphic&& other) { if (!other) { @@ -698,7 +698,7 @@ DynamicCast(PolymorphicValue&& other) } if (auto ptr = dynamic_cast(other.ptr_)) { - PolymorphicValue result; + Polymorphic result; using CBT = detail::DelegatingPolymorphicStorage; result.s_ = new CBT(std::move(other.s_)); result.ptr_ = result.s_->ptr(); @@ -710,33 +710,33 @@ DynamicCast(PolymorphicValue&& other) return {}; } -/** Exchanges the state of two PolymorphicValue objects. +/** Exchanges the state of two Polymorphic objects. - @tparam Base The type of the PolymorphicValue. - @param lhs The first PolymorphicValue to swap. - @param rhs The second PolymorphicValue to swap. + @tparam Base The type of the Polymorphic. + @param lhs The first Polymorphic to swap. + @param rhs The second Polymorphic to swap. Effects: Equivalent to p.swap(u). */ template constexpr void -swap(PolymorphicValue& lhs, PolymorphicValue& rhs) noexcept +swap(Polymorphic& lhs, Polymorphic& rhs) noexcept { lhs.swap(rhs); } -/** Determine if a PolymorphicValue is of a given type. +/** Determine if a Polymorphic is of a given type. @tparam Derived The type to check for. - @tparam Base The type of the PolymorphicValue. - @param pv The PolymorphicValue to check. + @tparam Base The type of the Polymorphic. + @param pv The Polymorphic to check. @return true if pv owns an object of type Derived, otherwise false. */ template requires std::derived_from bool -IsA(PolymorphicValue const& pv) +IsA(Polymorphic const& pv) { if (!pv) { @@ -745,7 +745,7 @@ IsA(PolymorphicValue const& pv) return dynamic_cast(std::addressof(*pv)); } -/** Retrieves the value of the PolymorphicValue as a qualified Derived type. +/** Retrieves the value of the Polymorphic as a qualified Derived type. This function can retrieve the value as a pointer, reference, or type name, and can handle const-qualified versions. @@ -758,9 +758,9 @@ IsA(PolymorphicValue const& pv) `nullptr` and the reference/type name versions throw an exception. @tparam T The requested type (e.g., DerivedTypeName*, DerivedTypeName&, or DerivedTypeName). - @tparam Base The base type of the PolymorphicValue. - @param pv The PolymorphicValue to retrieve the value from. - @return The value of the PolymorphicValue as the requested type. + @tparam Base The base type of the Polymorphic. + @param pv The Polymorphic to retrieve the value from. + @return The value of the Polymorphic as the requested type. @throws std::bad_cast if the requested type is a reference or type name and the object is not of the derived type. */ template @@ -768,7 +768,7 @@ requires std::is_pointer_v && std::derived_from, Base> T -get(PolymorphicValue& pv) +get(Polymorphic& pv) { return dynamic_cast(pv.operator->()); } @@ -779,7 +779,7 @@ requires std::is_reference_v && std::derived_from, Base> T -get(PolymorphicValue& pv) +get(Polymorphic& pv) { if (auto* ptr = dynamic_cast*>(pv.operator->())) { @@ -795,7 +795,7 @@ requires (!std::is_reference_v) && std::derived_from, Base> T& -get(PolymorphicValue& pv) +get(Polymorphic& pv) { return get(pv); } @@ -806,7 +806,7 @@ requires std::is_pointer_v && std::derived_from, Base> std::add_const_t>* -get(PolymorphicValue const& pv) +get(Polymorphic const& pv) { return dynamic_cast>*>(pv.operator->()); } @@ -817,7 +817,7 @@ requires std::is_reference_v && std::derived_from, Base> std::add_const_t>& -get(PolymorphicValue const& pv) +get(Polymorphic const& pv) { if (auto* ptr = dynamic_cast>*>(pv.operator->())) { @@ -833,14 +833,14 @@ requires (!std::is_reference_v) && std::derived_from, Base> std::add_const_t& -get(PolymorphicValue const& pv) +get(Polymorphic const& pv) { return get(pv); } -/** Compares two PolymorphicValue that have visit functions +/** Compares two Polymorphic that have visit functions - This function compares two PolymorphicValue objects that + This function compares two Polymorphic objects that have visit functions for the Base type. The visit function is used to compare the two objects @@ -852,17 +852,17 @@ get(PolymorphicValue const& pv) If any of the objects is empty, the comparison is based on the emptiness of the objects. - @tparam Base The type of the PolymorphicValue. - @param lhs The first PolymorphicValue to compare. - @param rhs The second PolymorphicValue to compare. - @return true if the two PolymorphicValue objects are equal, otherwise false. + @tparam Base The type of the Polymorphic. + @param lhs The first Polymorphic to compare. + @param rhs The second Polymorphic to compare. + @return true if the two Polymorphic objects are equal, otherwise false. */ template requires detail::CanVisitCompare auto CompareDerived( - PolymorphicValue const& lhs, - PolymorphicValue const& rhs) + Polymorphic const& lhs, + Polymorphic const& rhs) { if (lhs && rhs) { @@ -876,6 +876,41 @@ CompareDerived( : std::strong_ordering::greater; } +/// @copydoc CompareDerived +template +requires + (!IsPolymorphic_v) && + detail::CanVisitCompare +auto +CompareDerived(Base const& lhs, Base const& rhs) +{ + if (lhs.Kind == rhs.Kind) + { + return visit(lhs, detail::VisitCompareFn(rhs)); + } + return lhs.Kind <=> rhs.Kind; +} + +template +requires detail::CanVisitCompare +auto +operator<=>( + Polymorphic const& lhs, + Polymorphic const& rhs) +{ + return CompareDerived(lhs, rhs); +} + +template +requires detail::CanVisitCompare +bool +operator==( + Polymorphic const& lhs, + Polymorphic const& rhs) +{ + return lhs <=> rhs == std::strong_ordering::equal; +} + } // clang::mrdocs #endif diff --git a/include/mrdocs/ADT/detail/PolymorphicValue.hpp b/include/mrdocs/ADT/detail/Polymorphic.hpp similarity index 96% rename from include/mrdocs/ADT/detail/PolymorphicValue.hpp rename to include/mrdocs/ADT/detail/Polymorphic.hpp index 7891be7c09..eabf80d65c 100644 --- a/include/mrdocs/ADT/detail/PolymorphicValue.hpp +++ b/include/mrdocs/ADT/detail/Polymorphic.hpp @@ -9,8 +9,8 @@ // Official repository: https://github.com/cppalliance/mrdocs // -#ifndef MRDOCS_API_ADT_DETAIL_POLYMORPHICVALUE_HPP -#define MRDOCS_API_ADT_DETAIL_POLYMORPHICVALUE_HPP +#ifndef MRDOCS_API_ADT_DETAIL_POLYMORPHIC_HPP +#define MRDOCS_API_ADT_DETAIL_POLYMORPHIC_HPP #include #include @@ -75,7 +75,7 @@ class DirectPolymorphicStorage final // Control block that holds the object in a unique_ptr // and stores a copier function // This is the main control block type used -// by the PolymorphicValue class +// by the Polymorphic class template class PointerPolymorphicStorage final : public PolymorphicStorage diff --git a/include/mrdocs/Corpus.hpp b/include/mrdocs/Corpus.hpp index 2dbbd6bc0b..dd74b0c7b4 100644 --- a/include/mrdocs/Corpus.hpp +++ b/include/mrdocs/Corpus.hpp @@ -150,7 +150,7 @@ class MRDOCS_VISIBLE */ template R, class F, class... Args> void - traverseIDs(R&& range, F&& f, Args&&... args) const + visitIDs(R&& range, F&& f, Args&&... args) const { for (SymbolID const& id : range) { @@ -200,7 +200,7 @@ class MRDOCS_VISIBLE if (!opts.skipInherited) { auto MS = allMembers(I); - traverseIDs(MS, + visitIDs(MS, std::forward(f), std::forward(args)...); for (SymbolID const& id : MS) @@ -210,7 +210,7 @@ class MRDOCS_VISIBLE traverse(opts, *MI, std::forward(f), std::forward(args)...); } } - else + else /* skipInherited */ { auto nonInherited = allMembers(I) | @@ -219,7 +219,7 @@ class MRDOCS_VISIBLE MRDOCS_CHECK_OR(MI, false); return MI->Parent == I.id; }); - traverseIDs(nonInherited, + visitIDs(nonInherited, std::forward(f), std::forward(args)...); if (opts.recursive) @@ -233,23 +233,28 @@ class MRDOCS_VISIBLE } } } - else + else /* ordered */ { auto members0 = allMembers(I); static_assert(range_of); std::vector members; members.reserve(std::ranges::distance(members0)); std::ranges::copy(members0, std::back_inserter(members)); - std::stable_sort(members.begin(), members.end(), + std::ranges::sort(members, [this](SymbolID const& lhs, SymbolID const& rhs) { auto const& lhsInfo = get(lhs); auto const& rhsInfo = get(rhs); - return lhsInfo < rhsInfo; + if (auto const cmp = lhsInfo.Name <=> rhsInfo.Name; + !std::is_eq(cmp)) + { + return std::is_lt(cmp); + } + return std::is_lt(CompareDerived(lhsInfo, rhsInfo)); }); if (!opts.skipInherited) { - traverseIDs(members, + visitIDs(members, std::forward(f), std::forward(args)...); if (opts.recursive) @@ -262,7 +267,7 @@ class MRDOCS_VISIBLE } } } - else + else /* skipInherited */ { auto nonInherited = members | @@ -271,7 +276,7 @@ class MRDOCS_VISIBLE MRDOCS_CHECK_OR(MI, false); return MI->Parent == I.id; }); - traverseIDs(nonInherited, + visitIDs(nonInherited, std::forward(f), std::forward(args)...); if (opts.recursive) diff --git a/include/mrdocs/Dom/LazyArray.hpp b/include/mrdocs/Dom/LazyArray.hpp index e267017604..a7119a13b1 100644 --- a/include/mrdocs/Dom/LazyArray.hpp +++ b/include/mrdocs/Dom/LazyArray.hpp @@ -75,8 +75,8 @@ class LazyArrayImpl : public ArrayImpl const_iterator_t begin_; const_sentinel_t end_; - [[no_unique_address]] size_type size_; - [[no_unique_address]] Context context_; + MRDOCS_NO_UNIQUE_ADDRESS size_type size_; + MRDOCS_NO_UNIQUE_ADDRESS Context context_; public: explicit diff --git a/include/mrdocs/Dom/LazyObject.hpp b/include/mrdocs/Dom/LazyObject.hpp index 2da3ebfdd6..1de9c7d116 100644 --- a/include/mrdocs/Dom/LazyObject.hpp +++ b/include/mrdocs/Dom/LazyObject.hpp @@ -11,8 +11,8 @@ #ifndef MRDOCS_LIB_DOM_LAZY_OBJECT_HPP #define MRDOCS_LIB_DOM_LAZY_OBJECT_HPP -#include #include +#include #include #include @@ -164,7 +164,7 @@ class LazyObjectImpl : public ObjectImpl { T const* underlying_; Object overlay_; - [[no_unique_address]] Context context_{}; + MRDOCS_NO_UNIQUE_ADDRESS Context context_{}; public: explicit diff --git a/include/mrdocs/Metadata/Info.hpp b/include/mrdocs/Metadata/Info.hpp index 69b09de303..2df866da81 100644 --- a/include/mrdocs/Metadata/Info.hpp +++ b/include/mrdocs/Metadata/Info.hpp @@ -138,6 +138,8 @@ struct MRDOCS_VISIBLE Info #define INFO(Type) constexpr bool is##Type() const noexcept { return Kind == InfoKind::Type; } #include + + auto operator<=>(const Info&) const = default; }; //------------------------------------------------ @@ -162,6 +164,8 @@ struct InfoCommonBase : Info static constexpr bool is##Kind() noexcept { return K == InfoKind::Kind; } #include + auto operator<=>(const InfoCommonBase&) const = default; + protected: constexpr explicit InfoCommonBase(SymbolID const& ID) : Info(K, ID) @@ -351,14 +355,6 @@ tag_invoke( }); } -/** Compare two Info objects - */ -MRDOCS_DECL -bool -operator<( - Info const& lhs, - Info const& rhs) noexcept; - } // clang::mrdocs #endif diff --git a/include/mrdocs/Metadata/Info/Concept.hpp b/include/mrdocs/Metadata/Info/Concept.hpp index 42e7627bb9..1073b7316b 100644 --- a/include/mrdocs/Metadata/Info/Concept.hpp +++ b/include/mrdocs/Metadata/Info/Concept.hpp @@ -15,6 +15,7 @@ #include #include #include +#include namespace clang::mrdocs { @@ -37,6 +38,9 @@ struct ConceptInfo final : InfoCommonBase(ID) { } + + std::strong_ordering + operator<=>(ConceptInfo const& other) const; }; MRDOCS_DECL diff --git a/include/mrdocs/Metadata/Info/Enum.hpp b/include/mrdocs/Metadata/Info/Enum.hpp index 3c85171459..615197cb29 100644 --- a/include/mrdocs/Metadata/Info/Enum.hpp +++ b/include/mrdocs/Metadata/Info/Enum.hpp @@ -12,7 +12,7 @@ #ifndef MRDOCS_API_METADATA_ENUM_HPP #define MRDOCS_API_METADATA_ENUM_HPP -#include +#include #include #include #include @@ -30,7 +30,7 @@ struct EnumInfo final // Set too nonempty to the type when this is an explicitly typed enum. For // enum Foo : short { ... }; // this will be "short". - PolymorphicValue UnderlyingType; + Polymorphic UnderlyingType; /** The members of this scope. diff --git a/include/mrdocs/Metadata/Info/Field.hpp b/include/mrdocs/Metadata/Info/Field.hpp index 56d01e3191..711cab72d0 100644 --- a/include/mrdocs/Metadata/Info/Field.hpp +++ b/include/mrdocs/Metadata/Info/Field.hpp @@ -30,7 +30,7 @@ struct FieldInfo final : InfoCommonBase { /** Type of the field */ - PolymorphicValue Type; + Polymorphic Type; /** The default member initializer, if any. */ diff --git a/include/mrdocs/Metadata/Info/Friend.hpp b/include/mrdocs/Metadata/Info/Friend.hpp index e14887159f..9ba3eb1a9e 100644 --- a/include/mrdocs/Metadata/Info/Friend.hpp +++ b/include/mrdocs/Metadata/Info/Friend.hpp @@ -28,7 +28,7 @@ struct FriendInfo final /** Befriended type. */ - PolymorphicValue FriendType; + Polymorphic FriendType; //-------------------------------------------- diff --git a/include/mrdocs/Metadata/Info/Function.hpp b/include/mrdocs/Metadata/Info/Function.hpp index 259b418f9c..37746ef1b3 100644 --- a/include/mrdocs/Metadata/Info/Function.hpp +++ b/include/mrdocs/Metadata/Info/Function.hpp @@ -21,8 +21,7 @@ #include #include #include -#include -#include +#include #include #include @@ -90,7 +89,7 @@ tag_invoke( struct Param { /** The type of this parameter */ - PolymorphicValue Type; + Polymorphic Type; /** The parameter name. @@ -104,7 +103,7 @@ struct Param Param() = default; Param( - PolymorphicValue&& type, + Polymorphic&& type, std::string&& name, std::string&& def_arg) : Type(std::move(type)) @@ -131,7 +130,7 @@ struct FunctionInfo final : InfoCommonBase { /// Info about the return type of this function. - PolymorphicValue ReturnType; + Polymorphic ReturnType; /// List of parameters. std::vector Params; @@ -175,6 +174,9 @@ struct FunctionInfo final : InfoCommonBase(ID) { } + + std::strong_ordering + operator<=>(const FunctionInfo& other) const; }; MRDOCS_DECL diff --git a/include/mrdocs/Metadata/Info/Guide.hpp b/include/mrdocs/Metadata/Info/Guide.hpp index fbcc008146..dd60e31345 100644 --- a/include/mrdocs/Metadata/Info/Guide.hpp +++ b/include/mrdocs/Metadata/Info/Guide.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include namespace clang::mrdocs { @@ -30,7 +31,7 @@ struct GuideInfo final This is always a SpecializationTypeInfo. */ - PolymorphicValue Deduced; + Polymorphic Deduced; /** Template head, if any. */ @@ -49,6 +50,9 @@ struct GuideInfo final explicit GuideInfo(SymbolID ID) noexcept : InfoCommonBase(ID) {} + + std::strong_ordering + operator<=>(GuideInfo const& other) const; }; MRDOCS_DECL diff --git a/include/mrdocs/Metadata/Info/Namespace.hpp b/include/mrdocs/Metadata/Info/Namespace.hpp index 8c5790b3e1..6affbb0625 100644 --- a/include/mrdocs/Metadata/Info/Namespace.hpp +++ b/include/mrdocs/Metadata/Info/Namespace.hpp @@ -32,6 +32,8 @@ struct NamespaceTranche { std::vector Concepts; std::vector Guides; std::vector Usings; + + auto operator<=>(NamespaceTranche const&) const = default; }; MRDOCS_DECL @@ -118,6 +120,8 @@ struct NamespaceInfo final : InfoCommonBase(ID) { } + + auto operator<=>(NamespaceInfo const&) const = default; }; MRDOCS_DECL diff --git a/include/mrdocs/Metadata/Info/NamespaceAlias.hpp b/include/mrdocs/Metadata/Info/NamespaceAlias.hpp index 632a22a00c..92b9acc852 100644 --- a/include/mrdocs/Metadata/Info/NamespaceAlias.hpp +++ b/include/mrdocs/Metadata/Info/NamespaceAlias.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include namespace clang::mrdocs { @@ -24,7 +24,7 @@ struct NamespaceAliasInfo final : InfoCommonBase { /** The aliased symbol. */ - PolymorphicValue AliasedSymbol; + Polymorphic AliasedSymbol; //-------------------------------------------- diff --git a/include/mrdocs/Metadata/Info/Record.hpp b/include/mrdocs/Metadata/Info/Record.hpp index d63487a398..efaf8e1931 100644 --- a/include/mrdocs/Metadata/Info/Record.hpp +++ b/include/mrdocs/Metadata/Info/Record.hpp @@ -12,7 +12,6 @@ #ifndef MRDOCS_API_METADATA_RECORD_HPP #define MRDOCS_API_METADATA_RECORD_HPP -#include #include #include #include @@ -20,9 +19,9 @@ #include #include #include +#include #include #include -#include namespace clang::mrdocs { @@ -220,14 +219,14 @@ allMembers(RecordInterface const& T) */ struct BaseInfo { - PolymorphicValue Type; + Polymorphic Type; AccessKind Access = AccessKind::Public; bool IsVirtual = false; BaseInfo() = default; BaseInfo( - PolymorphicValue&& type, + Polymorphic&& type, AccessKind const access, bool const is_virtual) : Type(std::move(type)) @@ -300,6 +299,9 @@ struct RecordInfo final : InfoCommonBase(ID) { } + + std::strong_ordering + operator<=>(const RecordInfo& other) const; }; constexpr diff --git a/include/mrdocs/Metadata/Info/Specialization.hpp b/include/mrdocs/Metadata/Info/Specialization.hpp index 41dadb32fa..458090f4bc 100644 --- a/include/mrdocs/Metadata/Info/Specialization.hpp +++ b/include/mrdocs/Metadata/Info/Specialization.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include namespace clang::mrdocs { @@ -25,7 +25,7 @@ struct SpecializationInfo final : InfoCommonBase { /** The template arguments the parent template is specialized for */ - std::vector> Args; + std::vector> Args; /** ID of the template to which the arguments pertain */ SymbolID Primary = SymbolID::invalid; diff --git a/include/mrdocs/Metadata/Info/Typedef.hpp b/include/mrdocs/Metadata/Info/Typedef.hpp index 7e1d148c10..4d47d5a640 100644 --- a/include/mrdocs/Metadata/Info/Typedef.hpp +++ b/include/mrdocs/Metadata/Info/Typedef.hpp @@ -16,6 +16,8 @@ #include #include #include +#include +#include namespace clang::mrdocs { @@ -23,7 +25,7 @@ namespace clang::mrdocs { struct TypedefInfo final : InfoCommonBase { - PolymorphicValue Type; + Polymorphic Type; /** Indicates if this is a new C++ "using"-style typedef @@ -47,6 +49,10 @@ struct TypedefInfo final : InfoCommonBase(ID) { } + + std::strong_ordering + operator<=>(TypedefInfo const& other) const; + }; MRDOCS_DECL diff --git a/include/mrdocs/Metadata/Info/Using.hpp b/include/mrdocs/Metadata/Info/Using.hpp index f7d54f0b74..4f45e27a1e 100644 --- a/include/mrdocs/Metadata/Info/Using.hpp +++ b/include/mrdocs/Metadata/Info/Using.hpp @@ -69,7 +69,7 @@ struct UsingInfo final /** The qualifier for a using declaration. */ - PolymorphicValue Qualifier; + Polymorphic Qualifier; //-------------------------------------------- diff --git a/include/mrdocs/Metadata/Info/Variable.hpp b/include/mrdocs/Metadata/Info/Variable.hpp index 36ef9ff090..c8d8ece54b 100644 --- a/include/mrdocs/Metadata/Info/Variable.hpp +++ b/include/mrdocs/Metadata/Info/Variable.hpp @@ -18,6 +18,7 @@ #include #include #include +#include namespace clang::mrdocs { @@ -30,7 +31,7 @@ struct VariableInfo final : InfoCommonBase { /** The type of the variable */ - PolymorphicValue Type; + Polymorphic Type; std::optional Template; @@ -54,6 +55,9 @@ struct VariableInfo final : InfoCommonBase(ID) { } + + std::strong_ordering + operator<=>(VariableInfo const& other) const; }; MRDOCS_DECL diff --git a/include/mrdocs/Metadata/Javadoc.hpp b/include/mrdocs/Metadata/Javadoc.hpp index 30def3ca14..628b60517c 100644 --- a/include/mrdocs/Metadata/Javadoc.hpp +++ b/include/mrdocs/Metadata/Javadoc.hpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -96,7 +96,7 @@ struct Node; @see https://www.doxygen.nl/manual/commands.html[Doxygen Special Tags] */ -enum class Kind +enum class NodeKind { // VFALCO Don't forget to update // Node::isText() and Node::isBlock() @@ -182,12 +182,12 @@ enum class Parts struct MRDOCS_DECL Node { - Kind kind; + NodeKind Kind; virtual ~Node() = default; - explicit Node(Kind kind_) noexcept - : kind(kind_) + explicit Node(NodeKind const kind_) noexcept + : Kind(kind_) { } @@ -198,10 +198,11 @@ struct MRDOCS_DECL return ! isBlock(); } + auto operator<=>(Node const&) const = default; bool operator==(Node const&)const noexcept = default; virtual bool equals(Node const& other) const noexcept { - return kind == other.kind; + return Kind == other.Kind; } }; @@ -221,12 +222,12 @@ struct Text : Node { std::string string; - static constexpr Kind static_kind = Kind::text; + static constexpr NodeKind static_kind = NodeKind::text; explicit Text( std::string string_ = std::string()) noexcept - : Node(Kind::text) + : Node(NodeKind::text) , string(std::move(string_)) { } @@ -236,17 +237,18 @@ struct Text : Node return false; } + auto operator<=>(Text const&) const = default; bool operator==(Text const&) const noexcept = default; bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } protected: Text( std::string string_, - Kind kind_) + NodeKind kind_) : Node(kind_) , string(std::move(string_)) { @@ -259,20 +261,21 @@ struct Styled final : Text { Style style; - static constexpr Kind static_kind = Kind::styled; + static constexpr auto static_kind = NodeKind::styled; Styled( std::string string_ = std::string(), Style style_ = Style::none) noexcept - : Text(std::move(string_), Kind::styled) + : Text(std::move(string_), NodeKind::styled) , style(style_) { } + auto operator<=>(Styled const&) const = default; bool operator==(Styled const&) const noexcept = default; bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } @@ -280,25 +283,26 @@ struct Styled final : Text /** A hyperlink. */ -struct Link : Text +struct Link final : Text { std::string href; - static constexpr Kind static_kind = Kind::link; + static constexpr auto static_kind = NodeKind::link; explicit Link( std::string string_ = std::string(), std::string href_ = std::string()) noexcept - : Text(std::move(string_), Kind::link) + : Text(std::move(string_), NodeKind::link) , href(std::move(href_)) { } + auto operator<=>(Link const&) const = default; bool operator==(Link const&) const noexcept = default; bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; @@ -309,26 +313,27 @@ struct Reference : Text { SymbolID id = SymbolID::invalid; - static constexpr Kind static_kind = Kind::reference; + static constexpr auto static_kind = NodeKind::reference; explicit Reference( std::string string_ = std::string()) noexcept - : Text(std::move(string_), Kind::reference) + : Text(std::move(string_), NodeKind::reference) { } + auto operator<=>(Reference const&) const = default; bool operator==(Reference const&) const noexcept = default; bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } protected: Reference( std::string string_, - Kind kind_) noexcept + NodeKind const kind_) noexcept : Text(std::move(string_), kind_) { } @@ -336,24 +341,25 @@ struct Reference : Text /** Documentation copied from another symbol. */ -struct Copied : Reference +struct Copied final : Reference { Parts parts; - static constexpr Kind static_kind = Kind::copied; + static constexpr auto static_kind = NodeKind::copied; Copied( std::string string_ = std::string(), Parts parts_ = Parts::all) noexcept - : Reference(std::move(string_), Kind::copied) + : Reference(std::move(string_), NodeKind::copied) , parts(parts_) { } + auto operator<=>(Copied const&) const = default; bool operator==(Copied const&) const noexcept = default; bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; @@ -373,7 +379,7 @@ struct Copied : Reference struct MRDOCS_DECL Block : Node { - std::vector> children; + std::vector> children; bool isBlock() const noexcept final { @@ -385,9 +391,26 @@ struct MRDOCS_DECL return children.empty(); } + auto operator<=>(Block const& other) const { + if (auto const cmp = children.size() <=> other.children.size(); + !std::is_eq(cmp)) + { + return cmp; + } + for (std::size_t i = 0; i < children.size(); ++i) + { + if (auto const cmp = *children[i] <=> *other.children[i]; + !std::is_eq(cmp)) + { + return cmp; + } + } + return std::strong_ordering::equal; + } + bool operator==(Block const& other) const noexcept { - if (kind != other.kind) + if (Kind != other.Kind) { return false; } @@ -401,7 +424,7 @@ struct MRDOCS_DECL bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } @@ -412,43 +435,44 @@ struct MRDOCS_DECL std::make_unique(std::forward(text)))); } - void append(std::vector>&& blocks); + void append(std::vector>&& blocks); - void append(std::vector> const& otherChildren); + void append(std::vector> const& otherChildren); protected: explicit Block( - Kind kind_, - std::vector> children_ = {}) noexcept + NodeKind const kind_, + std::vector> children_ = {}) noexcept : Node(kind_) , children(std::move(children_)) { } private: - Text& emplace_back(PolymorphicValue text); + Text& emplace_back(Polymorphic text); }; /** A manually specified section heading. */ -struct Heading : Block +struct Heading final : Block { - static constexpr Kind static_kind = Kind::heading; + static constexpr auto static_kind = NodeKind::heading; std::string string; Heading( std::string string_ = std::string()) noexcept - : Block(Kind::heading) + : Block(NodeKind::heading) , string(std::move(string_)) { } + auto operator<=>(Heading const&) const = default; bool operator==(Heading const&) const noexcept = default; bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; @@ -457,25 +481,26 @@ struct Heading : Block */ struct Paragraph : Block { - static constexpr Kind static_kind = Kind::paragraph; + static constexpr auto static_kind = NodeKind::paragraph; Paragraph() noexcept - : Block(Kind::paragraph) + : Block(NodeKind::paragraph) { } + auto operator<=>(Paragraph const&) const = default; bool operator==(Paragraph const&) const noexcept = default; bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } protected: explicit Paragraph( - Kind kind, - std::vector> children_ = {}) noexcept + NodeKind const kind, + std::vector> children_ = {}) noexcept : Block(kind, std::move(children_)) { } @@ -483,19 +508,20 @@ struct Paragraph : Block /** The brief description */ -struct Brief : Paragraph +struct Brief final : Paragraph { - static constexpr Kind static_kind = Kind::brief; + static constexpr NodeKind static_kind = NodeKind::brief; Brief() noexcept - : Paragraph(Kind::brief) + : Paragraph(NodeKind::brief) { } + auto operator<=>(Brief const&) const = default; bool operator==(Brief const&) const noexcept = default; bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; @@ -506,44 +532,46 @@ struct Brief : Paragraph a note, tip, important, caution, or warning. */ -struct Admonition : Paragraph +struct Admonition final : Paragraph { Admonish admonish; explicit Admonition( - Admonish admonish_ = Admonish::none) noexcept - : Paragraph(Kind::admonition) + Admonish const admonish_ = Admonish::none) noexcept + : Paragraph(NodeKind::admonition) , admonish(admonish_) { } + auto operator<=>(Admonition const&) const = default; bool operator==(Admonition const&) const noexcept = default; bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; /** Preformatted source code. */ -struct Code : Paragraph +struct Code final : Paragraph { // VFALCO we can add a language (e.g., C++), // then emit attributes in the generator. - static constexpr Kind static_kind = Kind::code; + static constexpr auto static_kind = NodeKind::code; Code() noexcept - : Paragraph(Kind::code) + : Paragraph(NodeKind::code) { } + auto operator<=>(Code const&) const = default; bool operator==(Code const&) const noexcept = default; bool equals(Node const& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; @@ -552,12 +580,13 @@ struct Code : Paragraph */ struct ListItem final : Paragraph { - static constexpr auto static_kind = Kind::list_item; + static constexpr auto static_kind = NodeKind::list_item; ListItem() - : Paragraph(Kind::list_item) + : Paragraph(NodeKind::list_item) {} + auto operator<=>(ListItem const&) const = default; bool operator==(ListItem const&) const noexcept = default; @@ -581,15 +610,32 @@ struct ListItem final : Paragraph */ struct UnorderedList final : Paragraph { - static constexpr auto static_kind = Kind::unordered_list; + static constexpr auto static_kind = NodeKind::unordered_list; std::vector items; UnorderedList() - : Paragraph(Kind::unordered_list) + : Paragraph(NodeKind::unordered_list) { } + auto operator<=>(UnorderedList const& other) const { + if (auto const cmp = items.size() <=> other.items.size(); + !std::is_eq(cmp)) + { + return cmp; + } + for (std::size_t i = 0; i < items.size(); ++i) + { + if (auto const cmp = items[i] <=> other.items[i]; + !std::is_eq(cmp)) + { + return cmp; + } + } + return std::strong_ordering::equal; + } + bool operator==(UnorderedList const&) const noexcept = default; @@ -613,12 +659,14 @@ struct UnorderedList final : Paragraph */ struct Details final : Paragraph { - static constexpr auto static_kind = Kind::details; + static constexpr auto static_kind = NodeKind::details; Details() - : Paragraph(Kind::details) + : Paragraph(NodeKind::details) {} + auto operator<=>(Details const&) const = default; + bool operator==(const Details&) const noexcept = default; @@ -639,52 +687,56 @@ struct Details final : Paragraph /** A @see paragraph */ -struct See : Paragraph +struct See final : Paragraph { - static constexpr Kind static_kind = Kind::see; + static constexpr auto static_kind = NodeKind::see; See() - : Paragraph(Kind::see) + : Paragraph(NodeKind::see) { } + auto operator<=>(See const&) const = default; + bool operator==(const See&) const noexcept = default; bool equals(const Node& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; /** Documentation for a function parameter */ -struct Param : Paragraph +struct Param final : Paragraph { std::string name; ParamDirection direction; - static constexpr Kind static_kind = Kind::param; + static constexpr auto static_kind = NodeKind::param; Param( std::string name_ = std::string(), Paragraph details_ = Paragraph(), - ParamDirection direction_ = ParamDirection::none) + ParamDirection const direction_ = ParamDirection::none) : Paragraph( - Kind::param, + NodeKind::param, std::move(details_.children)) , name(std::move(name_)) , direction(direction_) { } + auto operator<=>(Param const&) const = default; + bool operator==(const Param&) const noexcept = default; bool equals(const Node& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; @@ -692,114 +744,123 @@ struct Param : Paragraph /** Documentation for a function return type */ -struct Returns : Paragraph +struct Returns final : Paragraph { - static constexpr Kind static_kind = Kind::returns; + static constexpr NodeKind static_kind = NodeKind::returns; Returns() - : Paragraph(Kind::returns) + : Paragraph(NodeKind::returns) { } + auto operator<=>(Returns const&) const = default; + bool operator==(const Returns&) const noexcept = default; bool equals(const Node& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; /** Documentation for a template parameter */ -struct TParam : Paragraph +struct TParam final : Paragraph { std::string name; - static constexpr Kind static_kind = Kind::tparam; + static constexpr NodeKind static_kind = NodeKind::tparam; TParam() - : Paragraph(Kind::tparam) + : Paragraph(NodeKind::tparam) { } + auto operator<=>(TParam const&) const = default; bool operator==(const TParam&) const noexcept = default; bool equals(const Node& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; /** Documentation for a function parameter */ -struct Throws : Paragraph +struct Throws final : Paragraph { Reference exception; - static constexpr Kind static_kind = Kind::throws; + static constexpr NodeKind static_kind = NodeKind::throws; Throws( std::string exception_ = std::string(), Paragraph details_ = Paragraph()) : Paragraph( - Kind::throws, + NodeKind::throws, std::move(details_.children)) , exception(std::move(exception_)) { } + auto operator<=>(Throws const&) const = default; + bool operator==(const Throws&) const noexcept = default; bool equals(const Node& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; -struct Precondition : Paragraph +struct Precondition final : Paragraph { - static constexpr Kind static_kind = Kind::precondition; + static constexpr NodeKind static_kind = NodeKind::precondition; Precondition( Paragraph details_ = Paragraph()) : Paragraph( - Kind::precondition, + NodeKind::precondition, std::move(details_.children)) { } + auto operator<=>(Precondition const&) const = default; + bool operator==(const Precondition&) const noexcept = default; bool equals(const Node& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; struct Postcondition : Paragraph { - static constexpr Kind static_kind = Kind::postcondition; + static constexpr auto static_kind = NodeKind::postcondition; Postcondition( Paragraph details_ = Paragraph()) : Paragraph( - Kind::postcondition, + NodeKind::postcondition, std::move(details_.children)) { } + auto operator<=>(Postcondition const&) const = default; + bool operator==(const Postcondition&) const noexcept = default; bool equals(const Node& other) const noexcept override { - return kind == other.kind && + return Kind == other.Kind && *this == dynamic_cast(other); } }; @@ -812,50 +873,50 @@ template constexpr auto visit( - Kind kind, + NodeKind kind, F&& f, Args&&... args) { switch(kind) { - case Kind::admonition: + case NodeKind::admonition: return f.template operator()(std::forward(args)...); - case Kind::brief: + case NodeKind::brief: return f.template operator()(std::forward(args)...); - case Kind::code: + case NodeKind::code: return f.template operator()(std::forward(args)...); - case Kind::heading: + case NodeKind::heading: return f.template operator()(std::forward(args)...); - case Kind::link: + case NodeKind::link: return f.template operator()(std::forward(args)...); - case Kind::reference: + case NodeKind::reference: return f.template operator()(std::forward(args)...); - case Kind::copied: + case NodeKind::copied: return f.template operator()(std::forward(args)...); - case Kind::list_item: + case NodeKind::list_item: return f.template operator()(std::forward(args)...); - case Kind::unordered_list: + case NodeKind::unordered_list: return f.template operator()(std::forward(args)...); - case Kind::paragraph: + case NodeKind::paragraph: return f.template operator()(std::forward(args)...); - case Kind::param: + case NodeKind::param: return f.template operator()(std::forward(args)...); - case Kind::returns: + case NodeKind::returns: return f.template operator()(std::forward(args)...); - case Kind::styled: + case NodeKind::styled: return f.template operator()(std::forward(args)...); - case Kind::text: + case NodeKind::text: return f.template operator()(std::forward(args)...); - case Kind::tparam: + case NodeKind::tparam: return f.template operator()(std::forward(args)...); - case Kind::throws: + case NodeKind::throws: return f.template operator()(std::forward(args)...); - case Kind::details: + case NodeKind::details: return f.template operator()
(std::forward(args)...); - case Kind::see: + case NodeKind::see: return f.template operator()(std::forward(args)...); - case Kind::precondition: + case NodeKind::precondition: return f.template operator()(std::forward(args)...); - case Kind::postcondition: + case NodeKind::postcondition: return f.template operator()(std::forward(args)...); default: return f.template operator()(std::forward(args)...); @@ -882,47 +943,47 @@ visit( auto visitor = makeVisitor( node, std::forward(fn), std::forward(args)...); - switch(node.kind) + switch(node.Kind) { - case Kind::admonition: + case NodeKind::admonition: return visitor.template visit(); - case Kind::brief: + case NodeKind::brief: return visitor.template visit(); - case Kind::code: + case NodeKind::code: return visitor.template visit(); - case Kind::heading: + case NodeKind::heading: return visitor.template visit(); - case Kind::paragraph: + case NodeKind::paragraph: return visitor.template visit(); - case Kind::link: + case NodeKind::link: return visitor.template visit(); - case Kind::reference: + case NodeKind::reference: return visitor.template visit(); - case Kind::copied: + case NodeKind::copied: return visitor.template visit(); - case Kind::list_item: + case NodeKind::list_item: return visitor.template visit(); - case Kind::unordered_list: + case NodeKind::unordered_list: return visitor.template visit(); - case Kind::param: + case NodeKind::param: return visitor.template visit(); - case Kind::returns: + case NodeKind::returns: return visitor.template visit(); - case Kind::styled: + case NodeKind::styled: return visitor.template visit(); - case Kind::text: + case NodeKind::text: return visitor.template visit(); - case Kind::tparam: + case NodeKind::tparam: return visitor.template visit(); - case Kind::throws: + case NodeKind::throws: return visitor.template visit(); - case Kind::details: + case NodeKind::details: return visitor.template visit
(); - case Kind::see: + case NodeKind::see: return visitor.template visit(); - case Kind::precondition: + case NodeKind::precondition: return visitor.template visit(); - case Kind::postcondition: + case NodeKind::postcondition: return visitor.template visit(); default: MRDOCS_UNREACHABLE(); @@ -975,7 +1036,7 @@ class Corpus; struct MRDOCS_DECL Javadoc { - std::vector> blocks_; + std::vector> blocks_; /** Constructor. */ @@ -986,7 +1047,7 @@ struct MRDOCS_DECL */ explicit Javadoc( - std::vector> blocks); + std::vector> blocks); /** Return true if this is empty */ @@ -1001,12 +1062,12 @@ struct MRDOCS_DECL doc::Paragraph const* getBrief(Corpus const& corpus) const noexcept; - std::vector> const& + std::vector> const& getDescription(Corpus const& corpus) const noexcept; /** Return the list of top level blocks. */ - std::vector> const& + std::vector> const& getBlocks() const noexcept { return blocks_; @@ -1014,7 +1075,7 @@ struct MRDOCS_DECL // VFALCO This is unfortunately necessary for // the deserialization from bitcode... - std::vector>& + std::vector>& getBlocks() noexcept { return blocks_; @@ -1029,6 +1090,22 @@ struct MRDOCS_DECL output format. */ /** @{ */ + auto operator<=>(Javadoc const& other) const noexcept { + if (auto const cmp = blocks_.size() <=> other.blocks_.size(); + !std::is_eq(cmp)) + { + return cmp; + } + for (std::size_t i = 0; i < blocks_.size(); ++i) + { + if (auto cmp = CompareDerived(blocks_[i], other.blocks_[i]); + !std::is_eq(cmp)) + { + return cmp; + } + } + return std::strong_ordering::equal; + } bool operator==(Javadoc const&) const noexcept; bool operator!=(Javadoc const&) const noexcept; /* @} */ @@ -1062,7 +1139,7 @@ struct MRDOCS_DECL std::string emplace_back(T&& block) { - return emplace_back(MakePolymorphicValue(std::forward(block))); + return emplace_back(MakePolymorphic(std::forward(block))); } /** Append blocks from another javadoc to this. @@ -1072,11 +1149,11 @@ struct MRDOCS_DECL /** Append blocks from a list to this. */ void - append(std::vector>&& blocks); + append(std::vector>&& blocks); private: std::string - emplace_back(PolymorphicValue); + emplace_back(Polymorphic); }; inline diff --git a/include/mrdocs/Metadata/Name.hpp b/include/mrdocs/Metadata/Name.hpp index 762e9ea47d..d7fe9181fb 100644 --- a/include/mrdocs/Metadata/Name.hpp +++ b/include/mrdocs/Metadata/Name.hpp @@ -82,7 +82,7 @@ struct NameInfo and the template arguments. */ - PolymorphicValue Prefix; + Polymorphic Prefix; constexpr bool isIdentifier() const noexcept { return Kind == NameKind::Identifier; } constexpr bool isSpecialization() const noexcept { return Kind == NameKind::Specialization; } @@ -109,7 +109,7 @@ struct SpecializationNameInfo final { /** The template arguments. */ - std::vector> TemplateArgs; + std::vector> TemplateArgs; constexpr SpecializationNameInfo() noexcept @@ -152,16 +152,13 @@ visit( } } -inline +MRDOCS_DECL std::strong_ordering -operator<=>(PolymorphicValue const& lhs, PolymorphicValue const& rhs) -{ - return CompareDerived(lhs, rhs); -} +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs); inline bool -operator==(PolymorphicValue const& lhs, PolymorphicValue const& rhs) { +operator==(Polymorphic const& lhs, Polymorphic const& rhs) { return lhs <=> rhs == std::strong_ordering::equal; } @@ -182,7 +179,7 @@ void tag_invoke( dom::ValueFromTag, dom::Value& v, - PolymorphicValue const& I, + Polymorphic const& I, DomCorpus const* domCorpus) { if(! I) diff --git a/include/mrdocs/Metadata/Source.hpp b/include/mrdocs/Metadata/Source.hpp index 74d05df054..7959656779 100644 --- a/include/mrdocs/Metadata/Source.hpp +++ b/include/mrdocs/Metadata/Source.hpp @@ -128,6 +128,8 @@ struct MRDOCS_DECL constexpr virtual ~SourceInfo() = default; + auto operator<=>(SourceInfo const&) const = default; + protected: SourceInfo() = default; }; diff --git a/include/mrdocs/Metadata/Specifiers.hpp b/include/mrdocs/Metadata/Specifiers.hpp index bf884b880d..4a0551ef5d 100644 --- a/include/mrdocs/Metadata/Specifiers.hpp +++ b/include/mrdocs/Metadata/Specifiers.hpp @@ -78,6 +78,8 @@ struct ExplicitInfo /** The operand of the explicit-specifier, if any. */ std::string Operand; + + auto operator<=>(const ExplicitInfo&) const = default; }; /** Exception specification kinds @@ -131,10 +133,7 @@ enum class OperatorKind Amp, Pipe, Tilde, - Exclaim, Equal, - Less, - Greater, PlusEqual, MinusEqual, StarEqual, @@ -147,11 +146,17 @@ enum class OperatorKind GreaterGreater, LessLessEqual, GreaterGreaterEqual, + + // Relational operators + Exclaim, EqualEqual, ExclaimEqual, + Less, LessEqual, + Greater, GreaterEqual, Spaceship, + AmpAmp, PipePipe, PlusPlus, diff --git a/include/mrdocs/Metadata/Template.hpp b/include/mrdocs/Metadata/Template.hpp index 02c7a55eac..b7b9d8156a 100644 --- a/include/mrdocs/Metadata/Template.hpp +++ b/include/mrdocs/Metadata/Template.hpp @@ -6,6 +6,7 @@ // // Copyright (c) 2023 Vinnie Falco (vinnie.falco@gmail.com) // Copyright (c) 2023 Krystian Stasiowski (sdkrystian@gmail.com) +// Copyright (c) 2024 Alan de Freitas (alandefreitas@gmail.com) // // Official repository: https://github.com/cppalliance/mrdocs // @@ -14,7 +15,7 @@ #define MRDOCS_API_METADATA_TEMPLATE_HPP #include -#include +#include #include #include #include @@ -23,9 +24,6 @@ namespace clang::mrdocs { -std::strong_ordering -operator<=>(PolymorphicValue const& lhs, PolymorphicValue const& rhs); - enum class TArgKind : int { // type arguments @@ -94,7 +92,7 @@ struct TypeTArg final : IsTArg { /** Template argument type. */ - PolymorphicValue Type; + Polymorphic Type; auto operator<=>(TypeTArg const&) const = default; }; @@ -151,18 +149,9 @@ visit( } } -inline +MRDOCS_DECL std::strong_ordering -operator<=>(PolymorphicValue const& lhs, PolymorphicValue const& rhs) -{ - return CompareDerived(lhs, rhs); -} - -inline -bool -operator==(PolymorphicValue const& lhs, PolymorphicValue const& rhs) { - return lhs <=> rhs == std::strong_ordering::equal; -} +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs); MRDOCS_DECL std::string @@ -181,7 +170,7 @@ void tag_invoke( dom::ValueFromTag, dom::Value& v, - PolymorphicValue const& I, + Polymorphic const& I, DomCorpus const* domCorpus) { if (!I) @@ -218,7 +207,7 @@ struct TParam bool IsParameterPack = false; /** The default template argument, if any */ - PolymorphicValue Default; + Polymorphic Default; constexpr virtual ~TParam() = default; @@ -226,7 +215,7 @@ struct TParam constexpr bool isNonType() const noexcept { return Kind == TParamKind::NonType; } constexpr bool isTemplate() const noexcept { return Kind == TParamKind::Template; } - auto operator<=>(TParam const&) const = default; + std::strong_ordering operator<=>(TParam const&) const; protected: constexpr @@ -249,7 +238,7 @@ void tag_invoke( dom::ValueFromTag, dom::Value& v, - PolymorphicValue const& I, + Polymorphic const& I, DomCorpus const* domCorpus) { if (!I) @@ -306,43 +295,28 @@ struct TypeTParam final TParamKeyKind KeyKind = TParamKeyKind::Class; /** The type-constraint for the parameter, if any. */ - PolymorphicValue Constraint; + Polymorphic Constraint; - auto operator<=>(TypeTParam const&) const = default; + std::strong_ordering operator<=>(TypeTParam const&) const; }; struct NonTypeTParam final : TParamCommonBase { /** Type of the non-type template parameter */ - PolymorphicValue Type; + Polymorphic Type; - auto operator<=>(NonTypeTParam const&) const = default; + std::strong_ordering operator<=>(NonTypeTParam const&) const; }; struct TemplateTParam final : TParamCommonBase { /** Template parameters for the template-template parameter */ - std::vector> Params; + std::vector> Params; - auto operator<=>(TemplateTParam const& other) const - { - if (auto const r = Params.size() <=> other.Params.size(); - !std::is_eq(r)) - { - return r; - } - for (std::size_t i = 0; i < Params.size(); ++i) - { - if (auto const r = Params[i] <=> other.Params[i]; - !std::is_eq(r)) - { - return r; - } - } - return std::strong_ordering::equal; - } + std::strong_ordering + operator<=>(TemplateTParam const& other) const; }; template< @@ -376,16 +350,13 @@ visit( } } -inline +MRDOCS_DECL std::strong_ordering -operator<=>(PolymorphicValue const& lhs, PolymorphicValue const& rhs) -{ - return CompareDerived(lhs, rhs); -} +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs); inline bool -operator==(PolymorphicValue const& lhs, PolymorphicValue const& rhs) { +operator==(Polymorphic const& lhs, Polymorphic const& rhs) { return lhs <=> rhs == std::strong_ordering::equal; } @@ -407,8 +378,8 @@ toString(TemplateSpecKind kind); */ struct TemplateInfo { - std::vector> Params; - std::vector> Args; + std::vector> Params; + std::vector> Args; /** The requires-clause for the template parameter list, if any. */ @@ -435,9 +406,36 @@ struct TemplateInfo return TemplateSpecKind::Partial; } - auto operator<=>(TemplateInfo const&) const = default; + std::strong_ordering + operator<=>(TemplateInfo const& other) const; }; +inline +auto +operator<=>(std::optional const& lhs, std::optional const& rhs) +{ + if (!lhs) + { + if (!rhs) + { + return std::strong_ordering::equal; + } + return std::strong_ordering::less; + } + if (!rhs) + { + return std::strong_ordering::greater; + } + return *lhs <=> *rhs; +} + +inline +bool +operator==(std::optional const& lhs, std::optional const& rhs) +{ + return lhs <=> rhs == std::strong_ordering::equal; +} + MRDOCS_DECL void tag_invoke( diff --git a/include/mrdocs/Metadata/Type.hpp b/include/mrdocs/Metadata/Type.hpp index 553cefea7f..ecd1d92ac1 100644 --- a/include/mrdocs/Metadata/Type.hpp +++ b/include/mrdocs/Metadata/Type.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include @@ -25,10 +25,10 @@ namespace clang::mrdocs { std::strong_ordering -operator<=>(PolymorphicValue const& lhs, PolymorphicValue const& rhs); +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs); std::strong_ordering -operator<=>(PolymorphicValue const& lhs, PolymorphicValue const& rhs); +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs); enum QualifierKind { @@ -183,7 +183,7 @@ void tag_invoke( dom::ValueFromTag, dom::Value& v, - PolymorphicValue const& I, + Polymorphic const& I, DomCorpus const* domCorpus) { if (!I) @@ -223,7 +223,7 @@ struct NamedTypeInfo final : TypeInfoCommonBase { QualifierKind CVQualifiers = QualifierKind::None; - PolymorphicValue Name; + Polymorphic Name; std::strong_ordering operator<=>(NamedTypeInfo const& other) const; @@ -243,15 +243,16 @@ struct AutoTypeInfo final { QualifierKind CVQualifiers = QualifierKind::None; AutoKind Keyword = AutoKind::Auto; - PolymorphicValue Constraint; + Polymorphic Constraint; - auto operator<=>(AutoTypeInfo const&) const = default; + std::strong_ordering + operator<=>(AutoTypeInfo const&) const; }; struct LValueReferenceTypeInfo final : TypeInfoCommonBase { - PolymorphicValue PointeeType; + Polymorphic PointeeType; TypeInfo* innerType() noexcept override @@ -259,13 +260,14 @@ struct LValueReferenceTypeInfo final return PointeeType.operator->(); } - auto operator<=>(LValueReferenceTypeInfo const&) const = default; + std::strong_ordering + operator<=>(LValueReferenceTypeInfo const&) const; }; struct RValueReferenceTypeInfo final : TypeInfoCommonBase { - PolymorphicValue PointeeType; + Polymorphic PointeeType; TypeInfo* innerType() noexcept override @@ -273,14 +275,15 @@ struct RValueReferenceTypeInfo final return PointeeType.operator->(); } - auto operator<=>(RValueReferenceTypeInfo const&) const = default; + std::strong_ordering + operator<=>(RValueReferenceTypeInfo const&) const; }; struct PointerTypeInfo final : TypeInfoCommonBase { QualifierKind CVQualifiers = QualifierKind::None; - PolymorphicValue PointeeType; + Polymorphic PointeeType; TypeInfo* innerType() noexcept override @@ -288,15 +291,16 @@ struct PointerTypeInfo final return PointeeType.operator->(); } - auto operator<=>(PointerTypeInfo const&) const = default; + std::strong_ordering + operator<=>(PointerTypeInfo const&) const; }; struct MemberPointerTypeInfo final : TypeInfoCommonBase { QualifierKind CVQualifiers = QualifierKind::None; - PolymorphicValue ParentType; - PolymorphicValue PointeeType; + Polymorphic ParentType; + Polymorphic PointeeType; TypeInfo* innerType() noexcept override @@ -304,13 +308,15 @@ struct MemberPointerTypeInfo final return PointeeType.operator->(); } - auto operator<=>(MemberPointerTypeInfo const&) const = default; + + std::strong_ordering + operator<=>(MemberPointerTypeInfo const&) const; }; struct ArrayTypeInfo final : TypeInfoCommonBase { - PolymorphicValue ElementType; + Polymorphic ElementType; ConstantExprInfo Bounds; TypeInfo* @@ -319,14 +325,15 @@ struct ArrayTypeInfo final return ElementType.operator->(); } - auto operator<=>(ArrayTypeInfo const&) const = default; + std::strong_ordering + operator<=>(ArrayTypeInfo const&) const; }; struct FunctionTypeInfo final : TypeInfoCommonBase { - PolymorphicValue ReturnType; - std::vector> ParamTypes; + Polymorphic ReturnType; + std::vector> ParamTypes; QualifierKind CVQualifiers = QualifierKind::None; ReferenceKind RefQualifier = ReferenceKind::None; NoexceptInfo ExceptionSpec; @@ -338,35 +345,8 @@ struct FunctionTypeInfo final return ReturnType.operator->(); } - auto - operator<=>(FunctionTypeInfo const& other) const { - if (auto const r = dynamic_cast(*this) <=> - dynamic_cast(other); - !std::is_eq(r)) - { - return r; - } - if (auto const r = ReturnType <=> other.ReturnType; - !std::is_eq(r)) - { - return r; - } - if (auto const r = ParamTypes.size() <=> other.ParamTypes.size(); - !std::is_eq(r)) - { - return r; - } - for (std::size_t i = 0; i < ParamTypes.size(); ++i) - { - if (auto const r = ParamTypes[i] <=> other.ParamTypes[i]; - !std::is_eq(r)) - { - return r; - } - } - return std::tie(CVQualifiers, RefQualifier, ExceptionSpec, IsVariadic) <=> - std::tie(other.CVQualifiers, other.RefQualifier, other.ExceptionSpec, other.IsVariadic); - } + std::strong_ordering + operator<=>(FunctionTypeInfo const&) const; }; template< @@ -423,16 +403,13 @@ visit( } } -inline +MRDOCS_DECL std::strong_ordering -operator<=>(PolymorphicValue const& lhs, PolymorphicValue const& rhs) -{ - return CompareDerived(lhs, rhs); -} +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs); inline bool -operator==(PolymorphicValue const& lhs, PolymorphicValue const& rhs) { +operator==(Polymorphic const& lhs, Polymorphic const& rhs) { return lhs <=> rhs == std::strong_ordering::equal; } diff --git a/include/mrdocs/Platform.hpp b/include/mrdocs/Platform.hpp index ea07c8af90..4c7f77e291 100644 --- a/include/mrdocs/Platform.hpp +++ b/include/mrdocs/Platform.hpp @@ -76,6 +76,14 @@ namespace mrdocs { # error mrdocs requires a 64-bit architecture #endif +#ifndef MRDOCS_NO_UNIQUE_ADDRESS +# if defined(__cpp_lib_no_unique_address) +# define MRDOCS_NO_UNIQUE_ADDRESS [[no_unique_address]] +# else +# define MRDOCS_NO_UNIQUE_ADDRESS +# endif +#endif + } // mrdocs } // clang diff --git a/include/mrdocs/Support/Concepts.hpp b/include/mrdocs/Support/Concepts.hpp index 9f0ebf9c96..711081e3d3 100644 --- a/include/mrdocs/Support/Concepts.hpp +++ b/include/mrdocs/Support/Concepts.hpp @@ -25,7 +25,7 @@ concept range_of = std::ranges::range && std::same_as` should be available and return diff --git a/include/mrdocs/mrdocs.natvis b/include/mrdocs/mrdocs.natvis index 29ef325ba0..c9882c627c 100644 --- a/include/mrdocs/mrdocs.natvis +++ b/include/mrdocs/mrdocs.natvis @@ -256,7 +256,7 @@ - + *{ptr_} (empty) diff --git a/share/mrdocs/addons/generator/common/partials/symbol/members-table.hbs b/share/mrdocs/addons/generator/common/partials/symbol/members-table.hbs index 86e5d41d73..2845944e29 100644 --- a/share/mrdocs/addons/generator/common/partials/symbol/members-table.hbs +++ b/share/mrdocs/addons/generator/common/partials/symbol/members-table.hbs @@ -22,7 +22,7 @@ {{/markup/tr}} {{/markup/thead}} {{#>markup/tbody}} -{{#each (filter_by (sort_by members "name") "isRegular" "isSeeBelow")}} +{{#each (filter_by members "isRegular" "isSeeBelow")}} {{> symbol/detail/members-table-row . includeBrief=true}} {{/each}} {{/markup/tbody}} @@ -35,7 +35,7 @@ {{/markup/tr}} {{/markup/thead}} {{#>markup/tbody}} -{{#each (filter_by (sort_by members "name") "isRegular" "isSeeBelow")}} +{{#each (filter_by members "isRegular" "isSeeBelow")}} {{> symbol/detail/members-table-row . includeBrief=false}} {{/each}} {{/markup/tbody}} diff --git a/src/lib/AST/ASTAction.cpp b/src/lib/AST/ASTAction.cpp index 485251f669..76e884ffe6 100644 --- a/src/lib/AST/ASTAction.cpp +++ b/src/lib/AST/ASTAction.cpp @@ -49,7 +49,7 @@ std::unique_ptr ASTAction:: CreateASTConsumer( clang::CompilerInstance& Compiler, - llvm::StringRef InFile) + llvm::StringRef) { return std::make_unique( config_, ex_, Compiler); diff --git a/src/lib/AST/ASTVisitor.cpp b/src/lib/AST/ASTVisitor.cpp index 964f7ae80a..122f077d77 100644 --- a/src/lib/AST/ASTVisitor.cpp +++ b/src/lib/AST/ASTVisitor.cpp @@ -1356,7 +1356,7 @@ populate( void ASTVisitor:: populate( - PolymorphicValue& I, + Polymorphic& I, const NamedDecl* N) { visit(N, [&](const DeclTy* P) @@ -1368,7 +1368,7 @@ populate( { if (!I) { - I = MakePolymorphicValue(); + I = MakePolymorphic(); } auto* R = dynamic_cast(I.operator->()); if (P->wasDeclaredWithTypename()) @@ -1397,7 +1397,7 @@ populate( { if (!I) { - I = MakePolymorphicValue(); + I = MakePolymorphic(); } auto* R = dynamic_cast(I.operator->()); R->Type = toTypeInfo(P->getType()); @@ -1412,7 +1412,7 @@ populate( { if (!I) { - I = MakePolymorphicValue(); + I = MakePolymorphic(); } auto const* TTPD = cast(P); MRDOCS_CHECK_OR(TTPD); @@ -1478,7 +1478,7 @@ populate( // parameter types we extracted have constraints for (auto it = TI.Params.begin(); it != TI.Params.end(); ) { - PolymorphicValue& param = *it; + Polymorphic& param = *it; if (auto const* T = dynamic_cast(param.operator->()); T && @@ -1526,7 +1526,7 @@ populate( void ASTVisitor:: populate( - std::vector>& result, + std::vector>& result, const ASTTemplateArgumentListInfo* args) { if (!args) @@ -1899,7 +1899,7 @@ generateJavadoc( return true; } -PolymorphicValue +Polymorphic ASTVisitor:: toTypeInfo(QualType const qt, TraversalMode const mode) { @@ -1917,7 +1917,7 @@ toTypeInfo(QualType const qt, TraversalMode const mode) return Builder.result(); } -PolymorphicValue +Polymorphic ASTVisitor:: toNameInfo( NestedNameSpecifier const* NNS) @@ -1929,7 +1929,7 @@ toNameInfo( MRDOCS_SYMBOL_TRACE(NNS, context_); ScopeExitRestore scope(mode_, Dependency); - PolymorphicValue I = nullptr; + Polymorphic I = nullptr; if (const Type* T = NNS->getAsType()) { NameInfoBuilder Builder(*this, NNS->getPrefix()); @@ -1938,13 +1938,13 @@ toNameInfo( } else if(const IdentifierInfo* II = NNS->getAsIdentifier()) { - I = MakePolymorphicValue(); + I = MakePolymorphic(); I->Name = II->getName(); I->Prefix = toNameInfo(NNS->getPrefix()); } else if(const NamespaceDecl* ND = NNS->getAsNamespace()) { - I = MakePolymorphicValue(); + I = MakePolymorphic(); I->Name = ND->getIdentifier()->getName(); I->Prefix = toNameInfo(NNS->getPrefix()); Decl const* ID = getInstantiatedFrom(ND); @@ -1955,7 +1955,7 @@ toNameInfo( } else if(const NamespaceAliasDecl* NAD = NNS->getAsNamespaceAlias()) { - I = MakePolymorphicValue(); + I = MakePolymorphic(); I->Name = NAD->getIdentifier()->getName(); I->Prefix = toNameInfo(NNS->getPrefix()); Decl const* ID = getInstantiatedFrom(NAD); @@ -1968,7 +1968,7 @@ toNameInfo( } template -PolymorphicValue +Polymorphic ASTVisitor:: toNameInfo( DeclarationName const Name, @@ -1979,16 +1979,16 @@ toNameInfo( { return nullptr; } - PolymorphicValue I = nullptr; + Polymorphic I = nullptr; if(TArgs) { - auto Specialization = MakePolymorphicValue(); + auto Specialization = MakePolymorphic(); populate(Specialization->TemplateArgs, *TArgs); - I = PolymorphicValue(std::move(Specialization)); + I = Polymorphic(std::move(Specialization)); } else { - I = MakePolymorphicValue(); + I = MakePolymorphic(); } I->Name = extractName(Name); if (NNS) @@ -1999,7 +1999,7 @@ toNameInfo( } template -PolymorphicValue +Polymorphic ASTVisitor:: toNameInfo( Decl const* D, @@ -2027,14 +2027,14 @@ toNameInfo( } template -PolymorphicValue +Polymorphic ASTVisitor:: toNameInfo>( Decl const* D, std::optional> TArgs, NestedNameSpecifier const* NNS); -PolymorphicValue +Polymorphic ASTVisitor:: toTArg(const TemplateArgument& A) { @@ -2063,7 +2063,7 @@ toTArg(const TemplateArgument& A) // type case TemplateArgument::Type: { - auto R = MakePolymorphicValue(); + auto R = MakePolymorphic(); QualType QT = A.getAsType(); MRDOCS_ASSERT(! QT.isNull()); // if the template argument is a pack expansion, @@ -2076,14 +2076,14 @@ toTArg(const TemplateArgument& A) QT = PT->getPattern(); } R->Type = toTypeInfo(QT); - return PolymorphicValue(R); + return Polymorphic(R); } // pack expansion of a template name case TemplateArgument::TemplateExpansion: // template name case TemplateArgument::Template: { - auto R = MakePolymorphicValue(); + auto R = MakePolymorphic(); R->IsPackExpansion = A.isPackExpansion(); // KRYSTIAN FIXME: template template arguments are @@ -2105,7 +2105,7 @@ toTArg(const TemplateArgument& A) TN.print(stream, context_.getPrintingPolicy(), TemplateName::Qualified::AsWritten); } - return PolymorphicValue(R); + return Polymorphic(R); } // nullptr value case TemplateArgument::NullPtr: @@ -2116,7 +2116,7 @@ toTArg(const TemplateArgument& A) // expression case TemplateArgument::Expression: { - auto R = MakePolymorphicValue(); + auto R = MakePolymorphic(); R->IsPackExpansion = A.isPackExpansion(); // if this is a pack expansion, use the template argument // expansion pattern in place of the template argument pack @@ -2127,7 +2127,7 @@ toTArg(const TemplateArgument& A) llvm::raw_string_ostream stream(R->Value.Written); adjusted.print(context_.getPrintingPolicy(), stream, false); - return PolymorphicValue(R); + return Polymorphic(R); } default: MRDOCS_UNREACHABLE(); diff --git a/src/lib/AST/ASTVisitor.hpp b/src/lib/AST/ASTVisitor.hpp index 27a81ec909..ecd6e50264 100644 --- a/src/lib/AST/ASTVisitor.hpp +++ b/src/lib/AST/ASTVisitor.hpp @@ -592,7 +592,7 @@ class ASTVisitor populate(ConstantExprInfo& I, Expr const* E, llvm::APInt const& V); void - populate(PolymorphicValue& I, NamedDecl const* N); + populate(Polymorphic& I, NamedDecl const* N); void populate(std::optional& TI, TemplateParameterList const* TPL) @@ -610,7 +610,7 @@ class ASTVisitor template Range> void populate( - std::vector>& result, + std::vector>& result, Range&& args) { for (TemplateArgument const& arg : args) @@ -635,7 +635,7 @@ class ASTVisitor void populate( - std::vector>& result, + std::vector>& result, ASTTemplateArgumentListInfo const* args); template InfoTy> @@ -696,34 +696,34 @@ class ASTVisitor std::optional& javadoc, Decl const* D); - PolymorphicValue + Polymorphic toTypeInfo(QualType qt, TraversalMode mode); - PolymorphicValue + Polymorphic toTypeInfo(QualType const qt) { return toTypeInfo(qt, TraversalMode::Dependency); } - PolymorphicValue + Polymorphic toNameInfo( NestedNameSpecifier const* NNS); template > - PolymorphicValue + Polymorphic toNameInfo( DeclarationName Name, std::optional TArgs = std::nullopt, NestedNameSpecifier const* NNS = nullptr); template > - PolymorphicValue + Polymorphic toNameInfo( Decl const* D, std::optional TArgs = std::nullopt, NestedNameSpecifier const* NNS = nullptr); - PolymorphicValue + Polymorphic toTArg(TemplateArgument const& A); // Pretty-print an expression diff --git a/src/lib/AST/NameInfoBuilder.cpp b/src/lib/AST/NameInfoBuilder.cpp index e86812c0a6..2d8d3d71a1 100644 --- a/src/lib/AST/NameInfoBuilder.cpp +++ b/src/lib/AST/NameInfoBuilder.cpp @@ -54,17 +54,17 @@ buildTerminal( { if (TArgs) { - auto I = MakePolymorphicValue(); + auto I = MakePolymorphic(); if (II) { I->Name = II->getName(); } getASTVisitor().populate(I->TemplateArgs, *TArgs); - Result = PolymorphicValue(std::move(I)); + Result = Polymorphic(std::move(I)); } else { - auto I = MakePolymorphicValue(); + auto I = MakePolymorphic(); if (II) { I->Name = II->getName(); @@ -107,7 +107,7 @@ buildTerminal( } }; - PolymorphicValue TI; + Polymorphic TI; if (!TArgs) { NameInfo Name; diff --git a/src/lib/AST/NameInfoBuilder.hpp b/src/lib/AST/NameInfoBuilder.hpp index 9e31973ed0..7b3089a49d 100644 --- a/src/lib/AST/NameInfoBuilder.hpp +++ b/src/lib/AST/NameInfoBuilder.hpp @@ -14,7 +14,7 @@ #ifndef MRDOCS_LIB_AST_NAMEINFOBUILDER_HPP #define MRDOCS_LIB_AST_NAMEINFOBUILDER_HPP -#include +#include #include #include @@ -23,12 +23,12 @@ namespace clang::mrdocs { class NameInfoBuilder : public TerminalTypeVisitor { - PolymorphicValue Result; + Polymorphic Result; public: using TerminalTypeVisitor::TerminalTypeVisitor; - PolymorphicValue + Polymorphic result() { return std::move(Result); diff --git a/src/lib/AST/ParseJavadoc.cpp b/src/lib/AST/ParseJavadoc.cpp index 2e80a69f7a..aec0c5104a 100644 --- a/src/lib/AST/ParseJavadoc.cpp +++ b/src/lib/AST/ParseJavadoc.cpp @@ -164,7 +164,7 @@ class JavadocVisitor FullComment const* FC_; Javadoc jd_; Diagnostics& diags_; - std::vector> params_; + std::vector> params_; doc::Block* block_ = nullptr; doc::Text* last_child_ = nullptr; std::size_t htmlTagNesting_ = 0; @@ -405,19 +405,19 @@ class JavadocVisitor TextTy elem(std::forward(args)...); bool can_merge = false; - if(last_child_ && last_child_->kind == elem.kind) + if (last_child_ && last_child_->Kind == elem.Kind) { - if constexpr(TextTy::static_kind == doc::Kind::text) + if constexpr(TextTy::static_kind == doc::NodeKind::text) can_merge = true; - if constexpr(TextTy::static_kind == doc::Kind::styled) + if constexpr(TextTy::static_kind == doc::NodeKind::styled) can_merge = dynamic_cast( last_child_)->style == elem.style; } if(! can_merge) { - auto new_text = MakePolymorphicValue(std::move(elem)); + auto new_text = MakePolymorphic(std::move(elem)); last_child_ = new_text.operator->(); block_->children.emplace_back(std::move(new_text)); } @@ -464,10 +464,10 @@ ensureUTF8( escaped by prefixing them with a backslash. */ -std::vector> +std::vector> parseStyled(StringRef s) { - std::vector> result; + std::vector> result; std::string currentText; auto currentStyle = doc::Style::none; bool escapeNext = false; @@ -481,7 +481,7 @@ parseStyled(StringRef s) if (currentStyle == doc::Style::none) { bool const lastIsSame = !result.empty() && - result.back()->kind == doc::Kind::text; + result.back()->Kind == doc::NodeKind::text; if (lastIsSame) { auto& lastText = static_cast(*result.back()); @@ -489,12 +489,12 @@ parseStyled(StringRef s) } else { - result.emplace_back(MakePolymorphicValue(std::move(currentText))); + result.emplace_back(MakePolymorphic(std::move(currentText))); } } else { bool const lastIsSame = !result.empty() && - result.back()->kind == doc::Kind::styled && + result.back()->Kind == doc::NodeKind::styled && dynamic_cast(*result.back()).style == currentStyle; if (lastIsSame) { @@ -503,7 +503,7 @@ parseStyled(StringRef s) } else { - result.emplace_back(MakePolymorphicValue(std::move(currentText), currentStyle)); + result.emplace_back(MakePolymorphic(std::move(currentText), currentStyle)); } } currentText.clear(); @@ -571,7 +571,7 @@ visitChildren( return; } - bool const isVerbatim = block_->kind == doc::Kind::code; + bool const isVerbatim = block_->Kind == doc::NodeKind::code; if (isVerbatim) { return; @@ -582,14 +582,14 @@ visitChildren( while(it != block_->children.end()) { if (auto& child = *it; - child->kind == doc::Kind::text) + child->Kind == doc::NodeKind::text) { auto* text = dynamic_cast(child.operator->()); MRDOCS_ASSERT(text); auto next = std::next(it); if(next != block_->children.end()) { - if((*next)->kind == doc::Kind::text) + if((*next)->Kind == doc::NodeKind::text) { auto* next_text = dynamic_cast(next->operator->()); MRDOCS_ASSERT(next_text); @@ -606,7 +606,7 @@ visitChildren( for (auto cIt = block_->children.begin(); cIt != block_->children.end();) { MRDOCS_ASSERT(cIt->operator->()); - if ((*cIt)->kind == doc::Kind::text) + if ((*cIt)->Kind == doc::NodeKind::text) { auto* text = dynamic_cast(cIt->operator->()); auto styledText = parseStyled(text->string); @@ -652,28 +652,28 @@ build() // Merge ListItems into UnorderedList auto& blocks = jd_.getBlocks(); for (auto it = blocks.begin(); it != blocks.end(); ) { - if ((*it)->kind == doc::Kind::list_item) { + if ((*it)->Kind == doc::NodeKind::list_item) { doc::UnorderedList ul; // Find last list item auto const begin = it; auto last = it; - while (last != blocks.end() && (*last)->kind == doc::Kind::list_item) { + while (last != blocks.end() && (*last)->Kind == doc::NodeKind::list_item) { ++last; } // Move list items to ul.items ul.items.reserve(std::distance(it, last)); for (auto li_it = begin; li_it != last; ++li_it) { - PolymorphicValue block = std::move(*li_it); + Polymorphic block = std::move(*li_it); MRDOCS_ASSERT(IsA(block)); - PolymorphicValue li = DynamicCast(std::move(block)); + Polymorphic li = DynamicCast(std::move(block)); ul.items.emplace_back(std::move(*li)); } // Remove the list items and insert the ul it = blocks.erase(begin, last); it = blocks.insert( it, - PolymorphicValue( - MakePolymorphicValue(std::move(ul)))); + Polymorphic( + MakePolymorphic(std::move(ul)))); } ++it; } @@ -1209,7 +1209,7 @@ visitBlockCommandComment( { // auto itr = std::ranges::find_if( // jd_.getBlocks(), - // [&](const PolymorphicValue & b) + // [&](const Polymorphic & b) // { // return b->kind == doc::Kind::returns; // }); @@ -1567,9 +1567,9 @@ visitParamCommandComment( auto const itr = std::ranges::find_if( jd_.getBlocks(), - [&](PolymorphicValue const& b) + [&](Polymorphic const& b) { - if (b->kind != doc::Kind::param) + if (b->Kind != doc::NodeKind::param) { return false; } @@ -1610,9 +1610,9 @@ visitTParamCommandComment( auto const itr = std::ranges::find_if( jd_.getBlocks(), - [&](PolymorphicValue const& b) + [&](Polymorphic const& b) { - if (b->kind != doc::Kind::tparam) + if (b->Kind != doc::NodeKind::tparam) { return false; } diff --git a/src/lib/AST/TypeInfoBuilder.cpp b/src/lib/AST/TypeInfoBuilder.cpp index 89e5cac427..d02aa27c68 100644 --- a/src/lib/AST/TypeInfoBuilder.cpp +++ b/src/lib/AST/TypeInfoBuilder.cpp @@ -17,7 +17,7 @@ namespace clang::mrdocs { void TypeInfoBuilder:: -buildPointer(const PointerType* T, unsigned quals) +buildPointer(const PointerType*, unsigned quals) { PointerTypeInfo I; I.CVQualifiers = toQualifierKind(quals); @@ -27,7 +27,7 @@ buildPointer(const PointerType* T, unsigned quals) void TypeInfoBuilder:: -buildLValueReference(const LValueReferenceType* T) +buildLValueReference(const LValueReferenceType*) { LValueReferenceTypeInfo I; *Inner = std::move(I); @@ -36,7 +36,7 @@ buildLValueReference(const LValueReferenceType* T) void TypeInfoBuilder:: -buildRValueReference(const RValueReferenceType* T) +buildRValueReference(const RValueReferenceType*) { RValueReferenceTypeInfo I; *Inner = std::move(I); @@ -150,7 +150,7 @@ buildTerminal( { NamedTypeInfo TI; TI.CVQualifiers = toQualifierKind(quals); - TI.Name = MakePolymorphicValue(); + TI.Name = MakePolymorphic(); TI.Name->Name = getASTVisitor().toString(T); TI.Name->Prefix = getASTVisitor().toNameInfo(NNS); TI.Constraints = this->Constraints; diff --git a/src/lib/AST/TypeInfoBuilder.hpp b/src/lib/AST/TypeInfoBuilder.hpp index 02da7a030c..f3c06dc238 100644 --- a/src/lib/AST/TypeInfoBuilder.hpp +++ b/src/lib/AST/TypeInfoBuilder.hpp @@ -40,7 +40,7 @@ class TypeInfoBuilder as a polymorphic `TypeInfo` object. */ - PolymorphicValue Result; + Polymorphic Result; /* A pointer to the inner type of result currently being populated. @@ -61,7 +61,7 @@ class TypeInfoBuilder `NamedTypeInfo` object, and the visiting process continues populating the `Inner` object. */ - PolymorphicValue* Inner = &Result; + Polymorphic* Inner = &Result; public: using TerminalTypeVisitor::TerminalTypeVisitor; @@ -73,7 +73,7 @@ class TypeInfoBuilder @return A unique pointer to the `TypeInfo` object. */ - PolymorphicValue + Polymorphic result() { return std::move(Result); diff --git a/src/lib/Gen/adoc/DocVisitor.cpp b/src/lib/Gen/adoc/DocVisitor.cpp index 084a6bc25f..87337472f2 100644 --- a/src/lib/Gen/adoc/DocVisitor.cpp +++ b/src/lib/Gen/adoc/DocVisitor.cpp @@ -314,7 +314,7 @@ operator()(doc::Throws const& I) const std::size_t DocVisitor:: -measureLeftMargin(std::vector> const& list) +measureLeftMargin(std::vector> const& list) { if(list.empty()) { diff --git a/src/lib/Gen/adoc/DocVisitor.hpp b/src/lib/Gen/adoc/DocVisitor.hpp index 53d940c122..0824f751bf 100644 --- a/src/lib/Gen/adoc/DocVisitor.hpp +++ b/src/lib/Gen/adoc/DocVisitor.hpp @@ -94,7 +94,7 @@ class DocVisitor static std::size_t - measureLeftMargin(std::vector> const& list); + measureLeftMargin(std::vector> const& list); }; } // hbs diff --git a/src/lib/Gen/hbs/MultiPageVisitor.cpp b/src/lib/Gen/hbs/MultiPageVisitor.cpp index 6681b41832..88985a1016 100644 --- a/src/lib/Gen/hbs/MultiPageVisitor.cpp +++ b/src/lib/Gen/hbs/MultiPageVisitor.cpp @@ -67,7 +67,8 @@ operator()(T const& I) // =================================== // Traverse the symbol members // =================================== - corpus_.traverse(I, *this); + Corpus::TraverseOptions opts = {.skipInherited = std::same_as}; + corpus_.traverse(opts, I, *this); }); } diff --git a/src/lib/Gen/hbs/SinglePageVisitor.cpp b/src/lib/Gen/hbs/SinglePageVisitor.cpp index 5342301896..66d89a4c50 100644 --- a/src/lib/Gen/hbs/SinglePageVisitor.cpp +++ b/src/lib/Gen/hbs/SinglePageVisitor.cpp @@ -36,9 +36,7 @@ operator()(T const& I) r.error().Throw(); } }); - Corpus::TraverseOptions opts = { - .ordered = true, - .skipInherited = std::same_as}; + Corpus::TraverseOptions opts = {.skipInherited = std::same_as}; corpus_.traverse(opts, I, *this); } diff --git a/src/lib/Gen/hbs/VisitorHelpers.cpp b/src/lib/Gen/hbs/VisitorHelpers.cpp index 03d2029283..b46994792c 100644 --- a/src/lib/Gen/hbs/VisitorHelpers.cpp +++ b/src/lib/Gen/hbs/VisitorHelpers.cpp @@ -50,7 +50,7 @@ resolveTypedef(Corpus const& c, Info const& I) if (I.Kind == InfoKind::Typedef) { auto const& TI = dynamic_cast(I); - PolymorphicValue const& T = TI.Type; + Polymorphic const& T = TI.Type; MRDOCS_CHECK_OR(T && T->Kind == TypeKind::Named, &I); auto const& NT = dynamic_cast(*T); MRDOCS_CHECK_OR(NT.Name, &I); @@ -168,7 +168,7 @@ findResolvedPrimarySiblingWithUrl(Corpus const& c, Info const& I) // The symbol is a typedef to a specialization if constexpr (std::same_as) { - PolymorphicValue const& T = U.Type; + Polymorphic const& T = U.Type; MRDOCS_CHECK_OR(T && T->Kind == TypeKind::Named, false); auto const& NT = dynamic_cast(*T); MRDOCS_CHECK_OR(NT.Name, false); diff --git a/src/lib/Gen/html/DocVisitor.cpp b/src/lib/Gen/html/DocVisitor.cpp index dc5829d3bc..0e71039d55 100644 --- a/src/lib/Gen/html/DocVisitor.cpp +++ b/src/lib/Gen/html/DocVisitor.cpp @@ -320,7 +320,7 @@ operator()(doc::Throws const& I) const std::size_t DocVisitor:: measureLeftMargin( - std::vector> const& list) + std::vector> const& list) { if(list.empty()) { diff --git a/src/lib/Gen/html/DocVisitor.hpp b/src/lib/Gen/html/DocVisitor.hpp index 520f36b18f..62de3259ae 100644 --- a/src/lib/Gen/html/DocVisitor.hpp +++ b/src/lib/Gen/html/DocVisitor.hpp @@ -92,7 +92,7 @@ class DocVisitor static std::size_t - measureLeftMargin(std::vector> const& list); + measureLeftMargin(std::vector> const& list); }; } // clang::mrdocs::html diff --git a/src/lib/Gen/xml/CXXTags.hpp b/src/lib/Gen/xml/CXXTags.hpp index 6377394a12..b428f80643 100644 --- a/src/lib/Gen/xml/CXXTags.hpp +++ b/src/lib/Gen/xml/CXXTags.hpp @@ -229,7 +229,7 @@ writeType( inline void writeType( - PolymorphicValue const& type, + Polymorphic const& type, XMLTags& tags) { if(! type) diff --git a/src/lib/Gen/xml/XMLWriter.cpp b/src/lib/Gen/xml/XMLWriter.cpp index b2df4aa297..c78d290b4c 100644 --- a/src/lib/Gen/xml/XMLWriter.cpp +++ b/src/lib/Gen/xml/XMLWriter.cpp @@ -216,7 +216,7 @@ writeNamespace( { tags_.write("using-directive", {}, { { id } }); } - corpus_.traverse({.ordered=true}, I, *this); + corpus_.traverse(I, *this); tags_.close(namespaceTagName); } @@ -242,7 +242,7 @@ writeEnum( writeJavadoc(I.javadoc); - corpus_.traverse({.ordered=true}, I, *this); + corpus_.traverse(I, *this); tags_.close(enumTagName); } @@ -357,7 +357,7 @@ XMLWriter:: writeOverloads( OverloadsInfo const& I) { - corpus_.traverse({.ordered=true}, I, *this); + corpus_.traverse(I, *this); } void @@ -513,7 +513,7 @@ writeRecord( writeJavadoc(I.javadoc); - corpus_.traverse({.ordered=true}, I, *this); + corpus_.traverse(I, *this); tags_.close(tagName); @@ -699,7 +699,7 @@ writeSpecialization( for(auto const& targ : I.Args) writeTemplateArg(*targ, tags_); - corpus_.traverse({.ordered=true}, I, *this); + corpus_.traverse(I, *this); tags_.close(specializationTagName); } @@ -725,66 +725,66 @@ void XMLWriter:: writeNode(doc::Node const& node) { - switch(node.kind) + switch(node.Kind) { - case doc::Kind::text: + case doc::NodeKind::text: writeText(dynamic_cast(node)); break; - case doc::Kind::styled: + case doc::NodeKind::styled: writeStyledText(dynamic_cast(node)); break; - case doc::Kind::heading: + case doc::NodeKind::heading: writeHeading(dynamic_cast(node)); break; - case doc::Kind::paragraph: + case doc::NodeKind::paragraph: writeParagraph(dynamic_cast(node)); break; - case doc::Kind::link: + case doc::NodeKind::link: writeLink(dynamic_cast(node)); break; - case doc::Kind::list_item: + case doc::NodeKind::list_item: writeListItem(dynamic_cast(node)); break; - case doc::Kind::unordered_list: + case doc::NodeKind::unordered_list: writeUnorderedList(dynamic_cast(node)); break; - case doc::Kind::brief: + case doc::NodeKind::brief: writeBrief(dynamic_cast(node)); break; - case doc::Kind::admonition: + case doc::NodeKind::admonition: writeAdmonition(dynamic_cast(node)); break; - case doc::Kind::code: + case doc::NodeKind::code: writeCode(dynamic_cast(node)); break; - case doc::Kind::param: + case doc::NodeKind::param: writeJParam(dynamic_cast(node)); break; - case doc::Kind::tparam: + case doc::NodeKind::tparam: writeTParam(dynamic_cast(node)); break; - case doc::Kind::returns: + case doc::NodeKind::returns: writeReturns(dynamic_cast(node)); break; - case doc::Kind::reference: + case doc::NodeKind::reference: writeReference(dynamic_cast(node)); break; - case doc::Kind::copied: + case doc::NodeKind::copied: writeCopied(dynamic_cast(node)); break; - case doc::Kind::throws: + case doc::NodeKind::throws: writeThrows(dynamic_cast(node)); break; - case doc::Kind::details: + case doc::NodeKind::details: writeDetails(dynamic_cast(node)); break; - case doc::Kind::see: + case doc::NodeKind::see: writeSee(dynamic_cast(node)); break; - case doc::Kind::precondition: + case doc::NodeKind::precondition: writePrecondition(dynamic_cast(node)); break; - case doc::Kind::postcondition: + case doc::NodeKind::postcondition: writePostcondition(dynamic_cast(node)); break; default: diff --git a/src/lib/Gen/xml/XMLWriter.hpp b/src/lib/Gen/xml/XMLWriter.hpp index 352fdcb86f..1f5baea827 100644 --- a/src/lib/Gen/xml/XMLWriter.hpp +++ b/src/lib/Gen/xml/XMLWriter.hpp @@ -99,7 +99,7 @@ class XMLWriter template void - writeNodes(std::vector> const& list) + writeNodes(std::vector> const& list) { for (auto const& node: list) { diff --git a/src/lib/Lib/ConfigOptions.json b/src/lib/Lib/ConfigOptions.json index 3fb9943cac..62bfd2f1dc 100644 --- a/src/lib/Lib/ConfigOptions.json +++ b/src/lib/Lib/ConfigOptions.json @@ -211,6 +211,48 @@ "details": "Determine whether symbols in anonymous namespaces should be extracted. When set to `always`, symbols in anonymous namespaces are always extracted. When set to `dependency`, symbols in anonymous namespaces are extracted only if they are referenced by the source code. When set to `never`, symbols in anonymous namespaces are never extracted.", "type": "bool", "default": true + }, + { + "name": "sort-members", + "brief": "Sort the members of a record or namespace", + "details": "When set to `true`, sort the members of a record or namespace by name and parameters. When set to `false`, the members are included in the declaration order they are extracted.", + "type": "bool", + "default": true + }, + { + "name": "sort-members-ctors-1st", + "brief": "Sort constructors first", + "details": "When set to `true`, constructors are sorted first in the list of members of a record.", + "type": "bool", + "default": true + }, + { + "name": "sort-members-dtors-1st", + "brief": "Sort destructors first", + "details": "When set to `true`, destructors are sorted first in the list of members of a record.", + "type": "bool", + "default": true + }, + { + "name": "sort-members-assignment-1st", + "brief": "Sort assignment operators first", + "details": "When set to `true`, assignment operators are sorted first in the list of members of a record.", + "type": "bool", + "default": true + }, + { + "name": "sort-members-conversion-last", + "brief": "Sort conversion operators last", + "details": "When set to `true`, conversion operators are sorted last in the list of members of a record or namespace.", + "type": "bool", + "default": true + }, + { + "name": "sort-members-relational-last", + "brief": "Sort relational operators last", + "details": "When set to `true`, relational operators are sorted last in the list of members of a record or namespace.", + "type": "bool", + "default": true } ] }, diff --git a/src/lib/Metadata/Finalize.cpp b/src/lib/Metadata/Finalize.cpp index 814e7f41f7..9c9a9a0082 100644 --- a/src/lib/Metadata/Finalize.cpp +++ b/src/lib/Metadata/Finalize.cpp @@ -12,6 +12,7 @@ #include "lib/Metadata/Finalizers/BaseMembersFinalizer.hpp" #include "lib/Metadata/Finalizers/OverloadsFinalizer.hpp" #include "lib/Metadata/Finalizers/ReferenceFinalizer.hpp" +#include "lib/Metadata/Finalizers/SortMembersFinalizer.hpp" #include "lib/Lib/Info.hpp" #include @@ -38,6 +39,16 @@ finalizeOverloads(InfoSet& Info, Config const& config) baseMembersFinalizer(*dynamic_cast(globalIt->get())); } +void +finalizeMemberOrder(InfoSet& Info, Config const& config) +{ + MRDOCS_CHECK_OR(config->sortMembers); + SortMembersFinalizer sortMembersFinalizer(Info, config); + auto const globalIt = Info.find(SymbolID::global); + MRDOCS_CHECK_OR(globalIt != Info.end()); + sortMembersFinalizer(*dynamic_cast(globalIt->get())); +} + void finalizeReferences(InfoSet& Info, SymbolLookup& Lookup) { @@ -62,6 +73,7 @@ finalize(CorpusImpl& corpus) { finalizeBaseMembers(corpus.info_, *corpus.config_); finalizeOverloads(corpus.info_, *corpus.config_); + finalizeMemberOrder(corpus.info_, *corpus.config_); auto const lookup = std::make_unique(corpus); finalizeReferences(corpus.info_, *lookup); } diff --git a/src/lib/Metadata/Finalizers/BaseMembersFinalizer.hpp b/src/lib/Metadata/Finalizers/BaseMembersFinalizer.hpp index a3aa35d13d..53090fda4a 100644 --- a/src/lib/Metadata/Finalizers/BaseMembersFinalizer.hpp +++ b/src/lib/Metadata/Finalizers/BaseMembersFinalizer.hpp @@ -73,7 +73,7 @@ class BaseMembersFinalizer operator()(RecordInfo& I); void - operator()(Info& I) {} + operator()(Info&) {} }; } // clang::mrdocs diff --git a/src/lib/Metadata/Finalizers/OverloadsFinalizer.hpp b/src/lib/Metadata/Finalizers/OverloadsFinalizer.hpp index 3bfa1bb074..1690fdc4b8 100644 --- a/src/lib/Metadata/Finalizers/OverloadsFinalizer.hpp +++ b/src/lib/Metadata/Finalizers/OverloadsFinalizer.hpp @@ -49,7 +49,7 @@ class OverloadsFinalizer operator()(RecordInfo& I); void - operator()(Info& I) {} + operator()(Info&) {} }; } // clang::mrdocs diff --git a/src/lib/Metadata/Finalizers/ReferenceFinalizer.cpp b/src/lib/Metadata/Finalizers/ReferenceFinalizer.cpp index 8b07d5d85c..7be748e6b5 100644 --- a/src/lib/Metadata/Finalizers/ReferenceFinalizer.cpp +++ b/src/lib/Metadata/Finalizers/ReferenceFinalizer.cpp @@ -41,7 +41,7 @@ resolveReference(doc::Reference& ref) const { // if we are copying the documentation of the // referenced symbol, ignore the current declaration - if (ref.kind == doc::Kind::copied) + if (ref.Kind == doc::NodeKind::copied) { return &I != current_; } @@ -80,7 +80,7 @@ resolveReference(doc::Reference& ref) const } // prevent recursive documentation copies - if (ref.kind == doc::Kind::copied && + if (ref.Kind == doc::NodeKind::copied && found && found->id == current_->id) { diff --git a/src/lib/Metadata/Finalizers/ReferenceFinalizer.hpp b/src/lib/Metadata/Finalizers/ReferenceFinalizer.hpp index 6ac0216d6c..a610372d02 100644 --- a/src/lib/Metadata/Finalizers/ReferenceFinalizer.hpp +++ b/src/lib/Metadata/Finalizers/ReferenceFinalizer.hpp @@ -114,7 +114,7 @@ class ReferenceFinalizer } template - void finalize(PolymorphicValue& v) requires + void finalize(Polymorphic& v) requires requires { this->finalize(*v); } { if (v) diff --git a/src/lib/Metadata/Finalizers/SortMembersFinalizer.cpp b/src/lib/Metadata/Finalizers/SortMembersFinalizer.cpp new file mode 100644 index 0000000000..70fbf2f34d --- /dev/null +++ b/src/lib/Metadata/Finalizers/SortMembersFinalizer.cpp @@ -0,0 +1,297 @@ +// +// Licensed under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// Copyright (c) 2025 Alan de Freitas (alandefreitas@gmail.com) +// +// Official repository: https://github.com/cppalliance/mrdocs +// + +#include "SortMembersFinalizer.hpp" +#include "lib/Support/NameParser.hpp" +#include +#include + +namespace clang::mrdocs { + +namespace { +// Comparison function for symbol IDs +struct SymbolIDCompareFn +{ + InfoSet& info_; + Config const& config_; + + template + static + std::optional + findFunctionClass(InfoTy const& I) + { + if constexpr (std::same_as) + { + return visit(I, [](U const& u) + -> std::optional + { + return findFunctionClass(u); + }); + } + else if constexpr ( + std::same_as || + std::same_as) + { + return I.Class; + } + return std::nullopt; + } + + template + static + std::optional + findOperatorKind(InfoTy const& I) + { + if constexpr (std::same_as) + { + return visit(I, [](U const& u) + -> std::optional + { + return findOperatorKind(u); + }); + } + else if constexpr ( + std::same_as || + std::same_as) + { + return I.OverloadedOperator; + } + return std::nullopt; + } + + bool + operator()(SymbolID const& lhsId, SymbolID const& rhsId) const + { + // Get Info from SymbolID + auto const& lhsInfoIt = info_.find(lhsId); + MRDOCS_CHECK_OR(lhsInfoIt != info_.end(), false); + auto const& rhsInfoIt = info_.find(rhsId); + MRDOCS_CHECK_OR(rhsInfoIt != info_.end(), true); + auto& lhsPtr = *lhsInfoIt; + MRDOCS_CHECK_OR(lhsPtr, false); + auto& rhsPtr = *rhsInfoIt; + MRDOCS_CHECK_OR(rhsPtr, true); + Info const& lhs = **lhsInfoIt; + Info const& rhs = **rhsInfoIt; + + std::optional const lhsClass = findFunctionClass(lhs); + std::optional const rhsClass = findFunctionClass(rhs); + if (config_->sortMembersCtors1St) + { + bool const lhsIsCtor = lhsClass && *lhsClass == FunctionClass::Constructor; + bool const rhsIsCtor = rhsClass && *rhsClass == FunctionClass::Constructor; + if (lhsIsCtor != rhsIsCtor) + { + return lhsIsCtor; + } + } + + if (config_->sortMembersDtors1St) + { + bool const lhsIsDtor = lhsClass && *lhsClass == FunctionClass::Destructor; + bool const rhsIsDtor = rhsClass && *rhsClass == FunctionClass::Destructor; + if (lhsIsDtor != rhsIsDtor) + { + return lhsIsDtor; + } + } + + std::optional const lhsOp = findOperatorKind(lhs); + std::optional const rhsOp = findOperatorKind(rhs); + if (config_->sortMembersAssignment1St) + { + bool const lhsIsAssign = lhsOp && *lhsOp == OperatorKind::Equal; + bool const rhsIsAssign = rhsOp && *rhsOp == OperatorKind::Equal; + if (lhsIsAssign != rhsIsAssign) + { + return lhsIsAssign; + } + } + + if (config_->sortMembersRelationalLast) + { + bool const lhsIsRel = lhsOp && ( + *lhsOp == OperatorKind::Exclaim || + *lhsOp == OperatorKind::EqualEqual || + *lhsOp == OperatorKind::ExclaimEqual || + *lhsOp == OperatorKind::Less || + *lhsOp == OperatorKind::Greater || + *lhsOp == OperatorKind::LessEqual || + *lhsOp == OperatorKind::GreaterEqual || + *lhsOp == OperatorKind::Spaceship); + bool const rhsIsRel = rhsOp && ( + *rhsOp == OperatorKind::Exclaim || + *rhsOp == OperatorKind::EqualEqual || + *rhsOp == OperatorKind::ExclaimEqual || + *rhsOp == OperatorKind::Less || + *rhsOp == OperatorKind::Greater || + *rhsOp == OperatorKind::LessEqual || + *rhsOp == OperatorKind::GreaterEqual || + *rhsOp == OperatorKind::Spaceship); + if (lhsIsRel != rhsIsRel) + { + return !lhsIsRel; + } + if (lhsIsRel && rhsIsRel) + { + return std::is_lt(*lhsOp <=> *rhsOp); + } + } + + if (config_->sortMembersConversionLast) + { + bool const lhsIsConvertion = lhsClass && *lhsClass == FunctionClass::Conversion; + bool const rhsIsConvertion = rhsClass && *rhsClass == FunctionClass::Conversion; + if (lhsIsConvertion != rhsIsConvertion) + { + return !lhsIsConvertion; + } + } + + if (auto const cmp = lhs.Name <=> rhs.Name; cmp != 0) + { + return std::is_lt(cmp); + } + + return std::is_lt(CompareDerived(lhs, rhs)); + } +}; +} // (anonymous) + +void +SortMembersFinalizer:: +sortMembers(std::vector& ids) +{ + SymbolIDCompareFn const pred{info_, config_}; + std::ranges::sort(ids, pred); +} + +void +SortMembersFinalizer:: +sortMembers(NamespaceTranche& T) +{ + sortMembers(T.Namespaces); + sortMembers(T.NamespaceAliases); + sortMembers(T.Typedefs); + sortMembers(T.Records); + sortMembers(T.Enums); + sortMembers(T.Functions); + sortMembers(T.Variables); + sortMembers(T.Concepts); + sortMembers(T.Guides); + sortMembers(T.Usings); +} + +void +SortMembersFinalizer:: +sortMembers(RecordTranche& T) +{ + sortMembers(T.NamespaceAliases); + sortMembers(T.Typedefs); + sortMembers(T.Records); + sortMembers(T.Enums); + sortMembers(T.Functions); + sortMembers(T.StaticFunctions); + sortMembers(T.Variables); + sortMembers(T.StaticVariables); + sortMembers(T.Concepts); + sortMembers(T.Guides); + sortMembers(T.Friends); + sortMembers(T.Usings); +} + +void +SortMembersFinalizer:: +sortMembers(RecordInterface& I) +{ + sortMembers(I.Public); + sortMembers(I.Protected); + sortMembers(I.Private); +} + +void +SortMembersFinalizer:: +sortNamespaceMembers(std::vector& ids) +{ + for (SymbolID const& id: ids) + { + auto infoIt = info_.find(id); + MRDOCS_CHECK_OR_CONTINUE(infoIt != info_.end()); + auto& info = *infoIt; + auto* ns = dynamic_cast(info.get()); + MRDOCS_CHECK_OR_CONTINUE(ns); + operator()(*ns); + } +} + +void +SortMembersFinalizer:: +sortRecordMembers(std::vector& ids) +{ + for (SymbolID const& id: ids) + { + auto infoIt = info_.find(id); + MRDOCS_CHECK_OR_CONTINUE(infoIt != info_.end()); + auto& info = *infoIt; + auto* record = dynamic_cast(info.get()); + MRDOCS_CHECK_OR_CONTINUE(record); + operator()(*record); + } +} + +void +SortMembersFinalizer:: +sortOverloadMembers(std::vector& ids) +{ + for (SymbolID const& id: ids) + { + auto infoIt = info_.find(id); + MRDOCS_CHECK_OR_CONTINUE(infoIt != info_.end()); + auto& info = *infoIt; + auto* overloads = dynamic_cast(info.get()); + MRDOCS_CHECK_OR_CONTINUE(overloads); + operator()(*overloads); + } +} + +void +SortMembersFinalizer:: +operator()(NamespaceInfo& I) +{ + sortMembers(I.Members); + sortRecordMembers(I.Members.Records); + sortNamespaceMembers(I.Members.Namespaces); + sortOverloadMembers(I.Members.Functions); +} + +void +SortMembersFinalizer:: +operator()(RecordInfo& I) +{ + sortMembers(I.Interface); + sortRecordMembers(I.Interface.Public.Records); + sortRecordMembers(I.Interface.Protected.Records); + sortRecordMembers(I.Interface.Private.Records); + sortOverloadMembers(I.Interface.Public.Functions); + sortOverloadMembers(I.Interface.Protected.Functions); + sortOverloadMembers(I.Interface.Private.Functions); + sortOverloadMembers(I.Interface.Public.StaticFunctions); + sortOverloadMembers(I.Interface.Protected.StaticFunctions); + sortOverloadMembers(I.Interface.Private.StaticFunctions); +} + +void +SortMembersFinalizer:: +operator()(OverloadsInfo& I) +{ + sortMembers(I.Members); +} + +} // clang::mrdocs diff --git a/src/lib/Metadata/Finalizers/SortMembersFinalizer.hpp b/src/lib/Metadata/Finalizers/SortMembersFinalizer.hpp new file mode 100644 index 0000000000..9a15133eb1 --- /dev/null +++ b/src/lib/Metadata/Finalizers/SortMembersFinalizer.hpp @@ -0,0 +1,74 @@ +// +// Licensed under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// Copyright (c) 2025 Alan de Freitas (alandefreitas@gmail.com) +// +// Official repository: https://github.com/cppalliance/mrdocs +// + +#ifndef MRDOCS_LIB_METADATA_FINALIZER_SORTMEMBERSFINALIZER_HPP +#define MRDOCS_LIB_METADATA_FINALIZER_SORTMEMBERSFINALIZER_HPP + +#include "lib/Lib/Info.hpp" +#include "lib/Lib/Lookup.hpp" + +namespace clang::mrdocs { + +/** Finalizes a set of Info. + + This removes any references to SymbolIDs + which do not exist. + + References which should always be valid + are not checked. +*/ +class SortMembersFinalizer +{ + InfoSet& info_; + Config const& config_; + + void + sortMembers(std::vector& ids); + + void + sortMembers(RecordInterface& I); + + void + sortMembers(RecordTranche& I); + + void + sortMembers(NamespaceTranche& I); + + void + sortNamespaceMembers(std::vector& id); + + void + sortRecordMembers(std::vector& id); + + void + sortOverloadMembers(std::vector& id); + +public: + SortMembersFinalizer(InfoSet& Info, Config const& config) + : info_(Info) + , config_(config) + {} + + void + operator()(NamespaceInfo& I); + + void + operator()(RecordInfo& I); + + void + operator()(OverloadsInfo& I); + + void + operator()(Info&) {} +}; + +} // clang::mrdocs + +#endif diff --git a/src/lib/Metadata/Info.cpp b/src/lib/Metadata/Info.cpp index ad57ddb037..db2746b0f6 100644 --- a/src/lib/Metadata/Info.cpp +++ b/src/lib/Metadata/Info.cpp @@ -66,51 +66,4 @@ merge(Info& I, Info&& Other) } } -bool -operator<( - Info const& lhs, - Info const& rhs) noexcept -{ - // Consider kind - if (lhs.Kind != rhs.Kind) - { - return lhs.Kind < rhs.Kind; - } - - // Consider name - if (lhs.Name != rhs.Name) - { - return lhs.Name < rhs.Name; - } - - // Consider template arguments - auto getTemplateInfoFn = [](auto const& U) - -> TemplateInfo const* - { - if constexpr (requires { U.Template; }) - { - MRDOCS_CHECK_OR(U.Template, nullptr); - return &*U.Template; - } - return nullptr; - }; - TemplateInfo const* lhsTemplate = visit(lhs, getTemplateInfoFn); - TemplateInfo const* rhsTemplate = visit(rhs, getTemplateInfoFn); - if (!lhsTemplate || !rhsTemplate) { - return lhsTemplate != nullptr; - } - if (lhsTemplate->Args.size() != rhsTemplate->Args.size()) - { - return lhsTemplate->Args.size() < rhsTemplate->Args.size(); - } - for (std::size_t i = 0; i < lhsTemplate->Args.size(); ++i) - { - if (lhsTemplate->Args[i] != rhsTemplate->Args[i]) - { - return lhsTemplate->Args[i]->Kind < rhsTemplate->Args[i]->Kind; - } - } - return false; -} - } // clang::mrdocs diff --git a/src/lib/Metadata/Info/Concept.cpp b/src/lib/Metadata/Info/Concept.cpp index 3a50182baf..66b6144c28 100644 --- a/src/lib/Metadata/Info/Concept.cpp +++ b/src/lib/Metadata/Info/Concept.cpp @@ -15,6 +15,49 @@ namespace clang::mrdocs { +std::strong_ordering +ConceptInfo:: +operator<=>(ConceptInfo const& other) const +{ + if (auto const cmp = Name <=> other.Name; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template.operator bool() <=> other.Template.operator bool(); + !std::is_eq(cmp)) + { + return cmp; + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args.size() <=> other.Template->Args.size(); + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params.size() <=> other.Template->Params.size(); + !std::is_eq(cmp)) + { + return cmp; + } + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args <=> other.Template->Args; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params <=> other.Template->Params; + !std::is_eq(cmp)) + { + return cmp; + } + } + return dynamic_cast(*this) <=> dynamic_cast(other); +} + void merge(ConceptInfo& I, ConceptInfo&& Other) { diff --git a/src/lib/Metadata/Info/Function.cpp b/src/lib/Metadata/Info/Function.cpp index d36dac5b58..7d30e316ca 100644 --- a/src/lib/Metadata/Info/Function.cpp +++ b/src/lib/Metadata/Info/Function.cpp @@ -50,10 +50,7 @@ static constinit Item const Table[] = { { "operator&", "operator_bitand", "an", OperatorKind::Amp }, { "operator|", "operator_bitor", "or", OperatorKind::Pipe }, { "operator~", "operator_bitnot", "co", OperatorKind::Tilde }, - { "operator!", "operator_not", "nt", OperatorKind::Exclaim }, { "operator=", "operator_assign", "as", OperatorKind::Equal }, - { "operator<", "operator_lt", "lt", OperatorKind::Less }, - { "operator>", "operator_gt", "gt", OperatorKind::Greater }, { "operator+=", "operator_plus_eq", "ple", OperatorKind::PlusEqual }, { "operator-=", "operator_minus_eq", "mie", OperatorKind::MinusEqual }, { "operator*=", "operator_star_eq", "mle", OperatorKind::StarEqual }, @@ -66,11 +63,17 @@ static constinit Item const Table[] = { { "operator>>", "operator_rshift", "rs", OperatorKind::GreaterGreater }, { "operator<<=", "operator_lshift_eq", "lse", OperatorKind::LessLessEqual }, { "operator>>=", "operator_rshift_eq", "rse", OperatorKind::GreaterGreaterEqual }, + + // relational operators + { "operator!", "operator_not", "nt", OperatorKind::Exclaim }, { "operator==", "operator_eq", "eq", OperatorKind::EqualEqual }, { "operator!=", "operator_not_eq", "ne", OperatorKind::ExclaimEqual }, + { "operator<", "operator_lt", "lt", OperatorKind::Less }, { "operator<=", "operator_le", "le", OperatorKind::LessEqual }, + { "operator>", "operator_gt", "gt", OperatorKind::Greater }, { "operator>=", "operator_ge", "ge", OperatorKind::GreaterEqual }, { "operator<=>", "operator_3way", "ss", OperatorKind::Spaceship }, + { "operator&&", "operator_and", "aa", OperatorKind::AmpAmp }, { "operator||", "operator_or", "oo", OperatorKind::PipePipe }, { "operator++", "operator_inc", "pp", OperatorKind::PlusPlus }, @@ -171,6 +174,59 @@ tag_invoke( v = dom::LazyObject(p, domCorpus); } +std::strong_ordering +FunctionInfo:: +operator<=>(const FunctionInfo& other) const +{ + if (auto const cmp = Name <=> other.Name; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Params.size() <=> other.Params.size(); + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template.operator bool() <=> other.Template.operator bool(); + !std::is_eq(cmp)) + { + return cmp; + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args.size() <=> other.Template->Args.size(); + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params.size() <=> other.Template->Params.size(); + !std::is_eq(cmp)) + { + return cmp; + } + } + if (auto const cmp = Params <=> other.Params; + !std::is_eq(cmp)) + { + return cmp; + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args <=> other.Template->Args; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params <=> other.Template->Params; + !std::is_eq(cmp)) + { + return cmp; + } + } + return dynamic_cast(*this) <=> dynamic_cast(other); +} + void merge(FunctionInfo& I, FunctionInfo&& Other) { diff --git a/src/lib/Metadata/Info/Guide.cpp b/src/lib/Metadata/Info/Guide.cpp index 4a38d563cf..9ec5712d9d 100644 --- a/src/lib/Metadata/Info/Guide.cpp +++ b/src/lib/Metadata/Info/Guide.cpp @@ -15,6 +15,60 @@ namespace clang::mrdocs { +std::strong_ordering +GuideInfo:: +operator<=>(GuideInfo const& other) const +{ + if (auto const cmp = Name <=> other.Name; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Params.size() <=> other.Params.size(); + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template.operator bool() <=> other.Template.operator bool(); + !std::is_eq(cmp)) + { + return cmp; + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args.size() <=> other.Template->Args.size(); + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params.size() <=> other.Template->Params.size(); + !std::is_eq(cmp)) + { + return cmp; + } + } + if (auto const cmp = Params <=> other.Params; + !std::is_eq(cmp)) + { + return cmp; + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args <=> other.Template->Args; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params <=> other.Template->Params; + !std::is_eq(cmp)) + { + return cmp; + } + } + return dynamic_cast(*this) <=> dynamic_cast(other); +} + + void merge(GuideInfo& I, GuideInfo&& Other) { MRDOCS_ASSERT(canMerge(I, Other)); diff --git a/src/lib/Metadata/Info/Record.cpp b/src/lib/Metadata/Info/Record.cpp index 1b73ba849c..d9c67c471d 100644 --- a/src/lib/Metadata/Info/Record.cpp +++ b/src/lib/Metadata/Info/Record.cpp @@ -48,6 +48,48 @@ reduceSymbolIDs( } } // (anon) +std::strong_ordering +RecordInfo:: +operator<=>(const RecordInfo& other) const +{ + if (auto const cmp = Name <=> other.Name; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template.operator bool() <=> other.Template.operator bool(); + !std::is_eq(cmp)) + { + return cmp; + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args.size() <=> other.Template->Args.size(); + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params.size() <=> other.Template->Params.size(); + !std::is_eq(cmp)) + { + return cmp; + } + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args <=> other.Template->Args; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params <=> other.Template->Params; + !std::is_eq(cmp)) + { + return cmp; + } + } + return dynamic_cast(*this) <=> dynamic_cast(other); +} void merge(RecordTranche& I, RecordTranche&& Other) diff --git a/src/lib/Metadata/Info/Typedef.cpp b/src/lib/Metadata/Info/Typedef.cpp index 34229c3bd8..dacd2f3c96 100644 --- a/src/lib/Metadata/Info/Typedef.cpp +++ b/src/lib/Metadata/Info/Typedef.cpp @@ -16,6 +16,49 @@ namespace clang::mrdocs { +std::strong_ordering +TypedefInfo:: +operator<=>(const TypedefInfo& other) const +{ + if (auto const cmp = Name <=> other.Name; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template.operator bool() <=> other.Template.operator bool(); + !std::is_eq(cmp)) + { + return cmp; + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args.size() <=> other.Template->Args.size(); + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params.size() <=> other.Template->Params.size(); + !std::is_eq(cmp)) + { + return cmp; + } + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args <=> other.Template->Args; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params <=> other.Template->Params; + !std::is_eq(cmp)) + { + return cmp; + } + } + return dynamic_cast(*this) <=> dynamic_cast(other); +} + void merge(TypedefInfo& I, TypedefInfo&& Other) { MRDOCS_ASSERT(canMerge(I, Other)); diff --git a/src/lib/Metadata/Info/Variable.cpp b/src/lib/Metadata/Info/Variable.cpp index 9aac20b31a..51b6748306 100644 --- a/src/lib/Metadata/Info/Variable.cpp +++ b/src/lib/Metadata/Info/Variable.cpp @@ -15,6 +15,49 @@ namespace clang::mrdocs { +std::strong_ordering +VariableInfo:: +operator<=>(VariableInfo const& other) const +{ + if (auto const cmp = Name <=> other.Name; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template.operator bool() <=> other.Template.operator bool(); + !std::is_eq(cmp)) + { + return cmp; + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args.size() <=> other.Template->Args.size(); + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params.size() <=> other.Template->Params.size(); + !std::is_eq(cmp)) + { + return cmp; + } + } + if (Template && other.Template) + { + if (auto const cmp = Template->Args <=> other.Template->Args; + !std::is_eq(cmp)) + { + return cmp; + } + if (auto const cmp = Template->Params <=> other.Template->Params; + !std::is_eq(cmp)) + { + return cmp; + } + } + return dynamic_cast(*this) <=> dynamic_cast(other); +} + void merge(VariableInfo& I, VariableInfo&& Other) { diff --git a/src/lib/Metadata/Javadoc.cpp b/src/lib/Metadata/Javadoc.cpp index cdd5a294d9..2f57f4f88a 100644 --- a/src/lib/Metadata/Javadoc.cpp +++ b/src/lib/Metadata/Javadoc.cpp @@ -26,7 +26,7 @@ namespace doc { Text& Block:: emplace_back( - PolymorphicValue text) + Polymorphic text) { MRDOCS_ASSERT(text->isText()); return *children.emplace_back(std::move(text)); @@ -34,7 +34,7 @@ emplace_back( void Block:: -append(std::vector>&& blocks) +append(std::vector>&& blocks) { children.reserve(children.size() + blocks.size()); for (auto&& block : blocks) @@ -46,7 +46,7 @@ append(std::vector>&& blocks) void Block:: -append(std::vector> const& otherChildren) +append(std::vector> const& otherChildren) { children.insert( children.end(), @@ -82,7 +82,7 @@ Javadoc() noexcept = default; Javadoc:: Javadoc( - std::vector> blocks) + std::vector> blocks) : blocks_(std::move(blocks)) { } @@ -99,11 +99,11 @@ getBrief(Corpus const& corpus) const noexcept doc::Block const* copied_brief = nullptr; for(auto const& block : blocks_) { - if (!brief && block->kind == doc::Kind::brief) + if (!brief && block->Kind == doc::NodeKind::brief) { brief = block.operator->(); } - if (!promoted_brief && block->kind == doc::Kind::paragraph) + if (!promoted_brief && block->Kind == doc::NodeKind::paragraph) { promoted_brief = block.operator->(); } @@ -118,7 +118,7 @@ getBrief(Corpus const& corpus) const noexcept // Look for a @copydoc command for (auto const& text : block->children) { - if (text->kind != doc::Kind::copied) + if (text->Kind != doc::NodeKind::copied) { continue; } @@ -150,7 +150,7 @@ getBrief(Corpus const& corpus) const noexcept return static_cast(brief); } -std::vector> const& +std::vector> const& Javadoc:: getDescription(Corpus const& corpus) const noexcept { @@ -221,35 +221,35 @@ makeOverview( it != list.end(); ++it) { MRDOCS_ASSERT(*it); - switch((*it)->kind) + switch((*it)->Kind) { - case doc::Kind::brief: + case doc::NodeKind::brief: break; - case doc::Kind::returns: + case doc::NodeKind::returns: ov.returns = dynamic_cast< doc::Returns const*>(it->operator->()); break; - case doc::Kind::param: + case doc::NodeKind::param: ov.params.push_back(dynamic_cast< doc::Param const*>(it->operator->())); break; - case doc::Kind::tparam: + case doc::NodeKind::tparam: ov.tparams.push_back(dynamic_cast< doc::TParam const*>(it->operator->())); break; - case doc::Kind::throws: + case doc::NodeKind::throws: ov.exceptions.push_back(dynamic_cast< doc::Throws const*>(it->operator->())); break; - case doc::Kind::see: + case doc::NodeKind::see: ov.sees.push_back(dynamic_cast< doc::See const*>(it->operator->())); break; - case doc::Kind::precondition: + case doc::NodeKind::precondition: ov.preconditions.push_back(dynamic_cast< doc::Precondition const*>(it->operator->())); break; - case doc::Kind::postcondition: + case doc::NodeKind::postcondition: ov.postconditions.push_back(dynamic_cast< doc::Postcondition const*>(it->operator->())); break; @@ -268,20 +268,20 @@ makeOverview( std::string Javadoc:: emplace_back( - PolymorphicValue block) + Polymorphic block) { MRDOCS_ASSERT(block->isBlock()); std::string result; - switch(block->kind) + switch(block->Kind) { - case doc::Kind::param: + case doc::NodeKind::param: { // check for duplicate parameter name auto t = dynamic_cast(block.operator->()); for(auto const& q : blocks_) { - if(q->kind == doc::Kind::param) + if(q->Kind == doc::NodeKind::param) { auto u = dynamic_cast(q.operator->()); if(u->name == t->name) @@ -294,13 +294,13 @@ emplace_back( } break; } - case doc::Kind::tparam: + case doc::NodeKind::tparam: { // check for duplicate template parameter name auto t = dynamic_cast(block.operator->()); for(auto const& q : blocks_) { - if(q->kind == doc::Kind::tparam) + if(q->Kind == doc::NodeKind::tparam) { auto u = dynamic_cast(q.operator->()); if(u->name == t->name) @@ -334,7 +334,7 @@ append( void Javadoc:: -append(std::vector>&& blocks) +append(std::vector>&& blocks) { blocks_.reserve(blocks_.size() + blocks.size()); for(auto&& blockAsNode : blocks) diff --git a/src/lib/Metadata/Name.cpp b/src/lib/Metadata/Name.cpp index 17e3bad452..86b40aafd7 100644 --- a/src/lib/Metadata/Name.cpp +++ b/src/lib/Metadata/Name.cpp @@ -15,8 +15,7 @@ #include #include -namespace clang { -namespace mrdocs { +namespace clang::mrdocs { dom::String toString(NameKind kind) noexcept { @@ -42,15 +41,21 @@ writeTo( std::strong_ordering NameInfo:: -operator<=>(NameInfo const& other) const +operator<=>(NameInfo const& other) const = default; + +std::strong_ordering +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs) { - auto const r = std::tie(Kind, id, Name, Prefix) <=> - std::tie(other.Kind, other.id, other.Name, other.Prefix); - if (!std::is_eq(r) || Kind == NameKind::Identifier) + if (lhs && rhs) { - return r; + if (lhs->Kind == rhs->Kind) + { + return visit(*lhs, detail::VisitCompareFn(*rhs)); + } + return lhs->Kind <=> rhs->Kind; } - return visit(other, detail::VisitCompareFn{other}); + return !lhs ? std::strong_ordering::less + : std::strong_ordering::greater; } static @@ -144,5 +149,4 @@ tag_invoke( v = dom::LazyObject(I, domCorpus); } -} // mrdocs -} // clang +} // clang::mrdocs diff --git a/src/lib/Metadata/Template.cpp b/src/lib/Metadata/Template.cpp index 7e0d271e01..57c407c66e 100644 --- a/src/lib/Metadata/Template.cpp +++ b/src/lib/Metadata/Template.cpp @@ -51,6 +51,10 @@ toString( } } +std::strong_ordering +TParam:: +operator<=>(TParam const&) const = default; + std::string_view toString( TParamKeyKind kind) noexcept @@ -66,6 +70,21 @@ toString( } } +std::strong_ordering +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs) +{ + if (lhs && rhs) + { + if (lhs->Kind == rhs->Kind) + { + return visit(*lhs, detail::VisitCompareFn(*rhs)); + } + return lhs->Kind <=> rhs->Kind; + } + return !lhs ? std::strong_ordering::less + : std::strong_ordering::greater; +} + std::string_view toString( TemplateSpecKind kind) @@ -83,6 +102,21 @@ toString( } } +std::strong_ordering +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs) +{ + if (lhs && rhs) + { + if (lhs->Kind == rhs->Kind) + { + return visit(*lhs, detail::VisitCompareFn(*rhs)); + } + return lhs->Kind <=> rhs->Kind; + } + return !lhs ? std::strong_ordering::less + : std::strong_ordering::greater; +} + std::string toString( TArg const& arg) noexcept @@ -149,6 +183,34 @@ tag_invoke( v = dom::LazyObject(I, domCorpus); } +std::strong_ordering +TypeTParam:: +operator<=>(TypeTParam const&) const = default; + +std::strong_ordering +NonTypeTParam:: +operator<=>(NonTypeTParam const&) const = default; + +std::strong_ordering +TemplateTParam:: +operator<=>(TemplateTParam const& other) const +{ + if (auto const r = Params.size() <=> other.Params.size(); + !std::is_eq(r)) + { + return r; + } + for (std::size_t i = 0; i < Params.size(); ++i) + { + if (auto const r = Params[i] <=> other.Params[i]; + !std::is_eq(r)) + { + return r; + } + } + return std::strong_ordering::equal; +} + template void tag_invoke( @@ -194,6 +256,23 @@ tag_invoke( v = dom::LazyObject(I, domCorpus); } +std::strong_ordering +TemplateInfo:: +operator<=>(TemplateInfo const& other) const { + if (auto const r = Args.size() <=> other.Args.size(); + !std::is_eq(r)) + { + return r; + } + if (auto const r = Params.size() <=> other.Params.size(); + !std::is_eq(r)) + { + return r; + } + return std::tie(Args, Params, Requires, Primary) <=> + std::tie(Args, Params, other.Requires, other.Primary); +} + template void tag_invoke( diff --git a/src/lib/Metadata/Type.cpp b/src/lib/Metadata/Type.cpp index 35d4046200..5534d816fe 100644 --- a/src/lib/Metadata/Type.cpp +++ b/src/lib/Metadata/Type.cpp @@ -13,8 +13,7 @@ #include #include -namespace clang { -namespace mrdocs { +namespace clang::mrdocs { dom::String toString( @@ -314,6 +313,62 @@ operator<=>(NamedTypeInfo const& other) const return Name <=> other.Name; } +std::strong_ordering +AutoTypeInfo:: +operator<=>(AutoTypeInfo const&) const = default; + +std::strong_ordering +LValueReferenceTypeInfo:: +operator<=>(LValueReferenceTypeInfo const&) const = default; + +std::strong_ordering +RValueReferenceTypeInfo:: +operator<=>(RValueReferenceTypeInfo const&) const = default; + +std::strong_ordering +PointerTypeInfo:: +operator<=>(PointerTypeInfo const&) const = default; + +std::strong_ordering +MemberPointerTypeInfo:: +operator<=>(MemberPointerTypeInfo const&) const = default; + +std::strong_ordering +ArrayTypeInfo:: +operator<=>(ArrayTypeInfo const&) const = default; + +std::strong_ordering +FunctionTypeInfo:: +operator<=>(FunctionTypeInfo const& other) const { + if (auto const r = dynamic_cast(*this) <=> + dynamic_cast(other); + !std::is_eq(r)) + { + return r; + } + if (auto const r = ReturnType <=> other.ReturnType; + !std::is_eq(r)) + { + return r; + } + if (auto const r = ParamTypes.size() <=> other.ParamTypes.size(); + !std::is_eq(r)) + { + return r; + } + for (std::size_t i = 0; i < ParamTypes.size(); ++i) + { + if (auto const r = ParamTypes[i] <=> other.ParamTypes[i]; + !std::is_eq(r)) + { + return r; + } + } + return std::tie(CVQualifiers, RefQualifier, ExceptionSpec, IsVariadic) <=> + std::tie(other.CVQualifiers, other.RefQualifier, other.ExceptionSpec, other.IsVariadic); +} + + std::string toString( const TypeInfo& T, @@ -404,5 +459,20 @@ tag_invoke( v = dom::LazyObject(I, domCorpus); } -} // mrdocs -} // clang +std::strong_ordering +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs) +{ + if (lhs && rhs) + { + if (lhs->Kind == rhs->Kind) + { + return visit(*lhs, detail::VisitCompareFn(*rhs)); + } + return lhs->Kind <=> rhs->Kind; + } + return !lhs ? std::strong_ordering::less + : std::strong_ordering::greater; +} + + +} // clang::mrdocs diff --git a/src/lib/Support/Handlebars.cpp b/src/lib/Support/Handlebars.cpp index 660abdb5db..adc69a6dca 100644 --- a/src/lib/Support/Handlebars.cpp +++ b/src/lib/Support/Handlebars.cpp @@ -142,7 +142,7 @@ class OverlayObjectImpl : public dom::ObjectImpl std::size_t size() const override { std::size_t n = parent_.size() + child_.size(); - child_.visit([&](dom::String const& key, dom::Value const& value) + child_.visit([&](dom::String const& key, dom::Value const&) { if (parent_.exists(key)) { @@ -6311,7 +6311,7 @@ registerContainerHelpers(Handlebars& hbs) { res.emplace_back(arr.at(i)); } - std::ranges::sort(res, [](auto const& a, auto const& b) { + std::stable_sort(res.begin(), res.end(), [](auto const& a, auto const& b) { return a < b; }); dom::Array res2; diff --git a/src/lib/Support/Radix.cpp b/src/lib/Support/Radix.cpp index 679bd29d32..d98b042830 100644 --- a/src/lib/Support/Radix.cpp +++ b/src/lib/Support/Radix.cpp @@ -239,12 +239,12 @@ toBaseFN( return {dest.data(), n}; } +#if 0 std::string_view toBase32( std::string& dest, - std::string_view src) + std::string_view) { -#if 0 std::vector v; v.reserve(2 * ((binaryString.size() + 14) / 15)); while(binaryString.size() >= 15) @@ -314,9 +314,9 @@ toBase32( dest.pop_back(); else break; -#endif return dest; } +#endif std::string toBase16( diff --git a/src/lib/Support/Radix.hpp b/src/lib/Support/Radix.hpp index 8e44b6d8c7..a8347e3fc3 100644 --- a/src/lib/Support/Radix.hpp +++ b/src/lib/Support/Radix.hpp @@ -20,8 +20,7 @@ #include #include -namespace clang { -namespace mrdocs { +namespace clang::mrdocs { std::string toBase64(std::string_view str); @@ -31,17 +30,18 @@ toBaseFN( llvm::SmallVectorImpl& dest, llvm::ArrayRef src); +#if 0 std::string_view toBase32( std::string& dest, std::string_view src); +#endif std::string toBase16( std::string_view str, bool lowercase = false); -} // mrdocs -} // clang +} // clang::mrdocs #endif diff --git a/src/test/ADT/PolymorphicValue.cpp b/src/test/ADT/Polymorphic.cpp similarity index 81% rename from src/test/ADT/PolymorphicValue.cpp rename to src/test/ADT/Polymorphic.cpp index 6dc8d18442..941e1ba11e 100644 --- a/src/test/ADT/PolymorphicValue.cpp +++ b/src/test/ADT/Polymorphic.cpp @@ -8,7 +8,7 @@ // Official repository: https://github.com/cppalliance/mrdocs // -#include +#include #include namespace clang::mrdocs { @@ -27,7 +27,7 @@ struct Z : X { int c{44}; }; -struct PolymorphicValue_test +struct Polymorphic_test { static void @@ -35,19 +35,19 @@ struct PolymorphicValue_test { // default constructor { - PolymorphicValue constexpr v; + Polymorphic constexpr v; BOOST_TEST_NOT(v); } // nullptr constructor { - PolymorphicValue constexpr v(nullptr); + Polymorphic constexpr v(nullptr); BOOST_TEST_NOT(v); } // from derived object { - PolymorphicValue x(Y{}); + Polymorphic x(Y{}); BOOST_TEST(x); BOOST_TEST(x->a == 42); BOOST_TEST(dynamic_cast(&*x)->b == 43); @@ -55,7 +55,7 @@ struct PolymorphicValue_test // from pointer { - PolymorphicValue x(new Y); + Polymorphic x(new Y); BOOST_TEST(x); BOOST_TEST(x->a == 42); BOOST_TEST(dynamic_cast(&*x)->b == 43); @@ -64,7 +64,7 @@ struct PolymorphicValue_test // from nullptr pointer { X* p = nullptr; - PolymorphicValue const x(p); + Polymorphic const x(p); BOOST_TEST_NOT(x); } @@ -72,18 +72,18 @@ struct PolymorphicValue_test { Y* p = new Y{}; X* p2 = p; - BOOST_TEST_THROWS(PolymorphicValue(p2), BadPolymorphicValueConstruction); + BOOST_TEST_THROWS(Polymorphic(p2), BadPolymorphicConstruction); } // from pointer and copier { auto copier = [](Y const& y) -> Y* { auto el = new Y(y); el->b = 44; return el; }; - PolymorphicValue x(new Y, copier); + Polymorphic x(new Y, copier); BOOST_TEST(x); BOOST_TEST(x->a == 42); BOOST_TEST(dynamic_cast(&*x)->b == 43); - PolymorphicValue x2(x); + Polymorphic x2(x); BOOST_TEST(x2); BOOST_TEST(x2->a == 42); BOOST_TEST(dynamic_cast(&*x2)->b == 44); @@ -93,12 +93,12 @@ struct PolymorphicValue_test { auto copier = [](Y const& y) -> Y* { auto el = new Y(y); el->b = 44; return el; }; auto deleter = [](Y const* y) { delete y; }; - PolymorphicValue x(new Y, copier, deleter); + Polymorphic x(new Y, copier, deleter); BOOST_TEST(x); BOOST_TEST(x->a == 42); BOOST_TEST(dynamic_cast(&*x)->b == 43); - PolymorphicValue x2(x); + Polymorphic x2(x); BOOST_TEST(x2); BOOST_TEST(x2->a == 42); BOOST_TEST(dynamic_cast(&*x2)->b == 44); @@ -108,16 +108,16 @@ struct PolymorphicValue_test { // from empty { - PolymorphicValue x; - PolymorphicValue y(x); + Polymorphic x; + Polymorphic y(x); BOOST_TEST_NOT(y); } // from valid { - PolymorphicValue x(new Y); + Polymorphic x(new Y); x->a = 45; - PolymorphicValue y(x); + Polymorphic y(x); BOOST_TEST(y); BOOST_TEST(y->a == 45); BOOST_TEST(dynamic_cast(&*y)->b == 43); @@ -126,9 +126,9 @@ struct PolymorphicValue_test // Move constructor { - PolymorphicValue x(new Y); + Polymorphic x(new Y); x->a = 45; - PolymorphicValue y(std::move(x)); + Polymorphic y(std::move(x)); BOOST_TEST_NOT(x); BOOST_TEST(y); BOOST_TEST(y->a == 45); @@ -139,16 +139,16 @@ struct PolymorphicValue_test { // from empty { - PolymorphicValue x; - PolymorphicValue y(x); + Polymorphic x; + Polymorphic y(x); BOOST_TEST_NOT(y); } // from valid { - PolymorphicValue x(new Y); + Polymorphic x(new Y); x->a = 45; - PolymorphicValue y(x); + Polymorphic y(x); BOOST_TEST(y); BOOST_TEST(y->a == 45); BOOST_TEST(dynamic_cast(&*y)->b == 43); @@ -159,16 +159,16 @@ struct PolymorphicValue_test { // from empty { - PolymorphicValue x; - PolymorphicValue y(std::move(x)); + Polymorphic x; + Polymorphic y(std::move(x)); BOOST_TEST_NOT(y); } // from valid { - PolymorphicValue x(new Y); + Polymorphic x(new Y); x->a = 45; - PolymorphicValue y(std::move(x)); + Polymorphic y(std::move(x)); BOOST_TEST_NOT(x); BOOST_TEST(y); BOOST_TEST(y->a == 45); @@ -178,7 +178,7 @@ struct PolymorphicValue_test // In-place constructor { - PolymorphicValue x(std::in_place_type); + Polymorphic x(std::in_place_type); BOOST_TEST(x); BOOST_TEST(x->a == 42); BOOST_TEST(dynamic_cast(&*x)->b == 43); @@ -201,7 +201,7 @@ struct PolymorphicValue_test #endif // from same { - PolymorphicValue lhs(new Y); + Polymorphic lhs(new Y); lhs = lhs; BOOST_TEST(lhs); BOOST_TEST(lhs->a == 42); @@ -214,17 +214,17 @@ struct PolymorphicValue_test #endif // from empty { - PolymorphicValue lhs; - PolymorphicValue rhs; + Polymorphic lhs; + Polymorphic rhs; lhs = rhs; BOOST_TEST_NOT(lhs); } // from valid { - PolymorphicValue lhs(new Y); + Polymorphic lhs(new Y); lhs->a = 45; - PolymorphicValue rhs(new Y); + Polymorphic rhs(new Y); rhs->a = 46; BOOST_TEST(lhs->a == 45); BOOST_TEST(rhs->a == 46); @@ -248,7 +248,7 @@ struct PolymorphicValue_test #endif // from same { - PolymorphicValue lhs(new Y); + Polymorphic lhs(new Y); lhs = std::move(lhs); BOOST_TEST(lhs); BOOST_TEST(lhs->a == 42); @@ -262,8 +262,8 @@ struct PolymorphicValue_test // from empty { - PolymorphicValue lhs; - PolymorphicValue rhs; + Polymorphic lhs; + Polymorphic rhs; lhs = std::move(rhs); BOOST_TEST_NOT(lhs); BOOST_TEST_NOT(rhs); @@ -271,9 +271,9 @@ struct PolymorphicValue_test // from valid { - PolymorphicValue lhs(new Y); + Polymorphic lhs(new Y); lhs->a = 45; - PolymorphicValue rhs(new Y); + Polymorphic rhs(new Y); rhs->a = 46; BOOST_TEST(lhs->a == 45); BOOST_TEST(rhs->a == 46); @@ -286,7 +286,7 @@ struct PolymorphicValue_test // copy from derived { - PolymorphicValue lhs(new Y); + Polymorphic lhs(new Y); lhs->a = 45; Y rhs; rhs.a = 46; @@ -300,7 +300,7 @@ struct PolymorphicValue_test // copy from derived { - PolymorphicValue lhs(new Y); + Polymorphic lhs(new Y); lhs->a = 45; Y rhs; rhs.a = 46; @@ -319,14 +319,14 @@ struct PolymorphicValue_test { // from derived object { - PolymorphicValue x(Y{}); + Polymorphic x(Y{}); BOOST_TEST((*x).a == 42); BOOST_TEST(dynamic_cast(&*x)->b == 43); } // from pointer { - PolymorphicValue x(new Y); + Polymorphic x(new Y); BOOST_TEST((*x).a == 42); BOOST_TEST(dynamic_cast(&*x)->b == 43); } @@ -336,9 +336,9 @@ struct PolymorphicValue_test void testMake() { - // MakePolymorphicValue(args...) + // MakePolymorphic(args...) { - auto x = MakePolymorphicValue(); + auto x = MakePolymorphic(); BOOST_TEST(x); BOOST_TEST(x->a == 42); BOOST_TEST(dynamic_cast(&*x)->b == 43); @@ -351,7 +351,7 @@ struct PolymorphicValue_test { // from valid { - PolymorphicValue x(new Y); + Polymorphic x(new Y); auto y = DynamicCast(std::move(x)); BOOST_TEST(y); BOOST_TEST(y->a == 42); @@ -360,14 +360,14 @@ struct PolymorphicValue_test // from empty { - PolymorphicValue x; + Polymorphic x; auto y = DynamicCast(std::move(x)); BOOST_TEST_NOT(y); } // from invalid derived type { - PolymorphicValue x(new Z); + Polymorphic x(new Z); auto y = DynamicCast(std::move(x)); BOOST_TEST_NOT(y); } @@ -379,8 +379,8 @@ struct PolymorphicValue_test { // default constructor { - PolymorphicValue lhs; - PolymorphicValue rhs(new Y); + Polymorphic lhs; + Polymorphic rhs(new Y); swap(lhs, rhs); BOOST_TEST(lhs); BOOST_TEST(lhs->a == 42); @@ -390,8 +390,8 @@ struct PolymorphicValue_test // rhs: default constructor { - PolymorphicValue lhs(new Y); - PolymorphicValue rhs; + Polymorphic lhs(new Y); + Polymorphic rhs; swap(lhs, rhs); BOOST_TEST_NOT(lhs); BOOST_TEST(rhs); @@ -401,8 +401,8 @@ struct PolymorphicValue_test // lhs: from derived object { - PolymorphicValue lhs(Y{}); - PolymorphicValue rhs(new Y); + Polymorphic lhs(Y{}); + Polymorphic rhs(new Y); swap(lhs, rhs); BOOST_TEST(rhs); BOOST_TEST(rhs->a == 42); @@ -414,8 +414,8 @@ struct PolymorphicValue_test // rhs: from derived object { - PolymorphicValue lhs(new Y); - PolymorphicValue rhs(Y{}); + Polymorphic lhs(new Y); + Polymorphic rhs(Y{}); swap(lhs, rhs); BOOST_TEST(lhs); BOOST_TEST(lhs->a == 42); @@ -427,8 +427,8 @@ struct PolymorphicValue_test // lhs: from pointer { - PolymorphicValue lhs(new Y); - PolymorphicValue rhs(new Y); + Polymorphic lhs(new Y); + Polymorphic rhs(new Y); swap(lhs, rhs); BOOST_TEST(rhs); BOOST_TEST(rhs->a == 42); @@ -445,14 +445,14 @@ struct PolymorphicValue_test { // IsA(x) { - PolymorphicValue const x(new Y); + Polymorphic const x(new Y); BOOST_TEST(IsA(x)); BOOST_TEST(IsA(x)); } // Empty state { - PolymorphicValue const x; + Polymorphic const x; BOOST_TEST_NOT(IsA(x)); BOOST_TEST_NOT(IsA(x)); } @@ -464,7 +464,7 @@ struct PolymorphicValue_test { // from mutable { - PolymorphicValue x(new Y); + Polymorphic x(new Y); // to mutable derived { @@ -517,7 +517,7 @@ struct PolymorphicValue_test // from const { - PolymorphicValue const x(new Y); + Polymorphic const x(new Y); // to mutable derived (returns const anyway) { @@ -578,8 +578,8 @@ struct PolymorphicValue_test }; TEST_SUITE( - PolymorphicValue_test, - "clang.mrdocs.ADT.PolymorphicValue"); + Polymorphic_test, + "clang.mrdocs.ADT.Polymorphic"); } // clang::mrdocs diff --git a/test-files/golden-tests/config/inherit-base-members/copy-dependencies.adoc b/test-files/golden-tests/config/inherit-base-members/copy-dependencies.adoc index 5f9890d17d..3873159502 100644 --- a/test-files/golden-tests/config/inherit-base-members/copy-dependencies.adoc +++ b/test-files/golden-tests/config/inherit-base-members/copy-dependencies.adoc @@ -353,8 +353,8 @@ Declared in `<copy‐dependencies.cpp>` do_derived_shadowed(); ---- -[#derived-do_excluded_inherited] -== <>::do_excluded_inherited +[#derived-excluded_inherited] +== <>::excluded_inherited This function should be inherited by derived classes. @@ -367,14 +367,14 @@ Declared in `<copy‐dependencies.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- excluded_base& -do_excluded_inherited(); +excluded_inherited(); ---- -[#derived-do_shadowed] -== <>::do_shadowed +[#derived-do_excluded_inherited] +== <>::do_excluded_inherited -This function should be shadowed by derived classes. +This function should be inherited by derived classes. === Synopsis @@ -384,14 +384,14 @@ Declared in `<copy‐dependencies.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- excluded_base& -do_shadowed(); +do_excluded_inherited(); ---- -[#derived-excluded_inherited] -== <>::excluded_inherited +[#derived-do_shadowed] +== <>::do_shadowed -This function should be inherited by derived classes. +This function should be shadowed by derived classes. === Synopsis @@ -401,7 +401,7 @@ Declared in `<copy‐dependencies.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- excluded_base& -excluded_inherited(); +do_shadowed(); ---- [#private_derived] diff --git a/test-files/golden-tests/config/inherit-base-members/copy-dependencies.html b/test-files/golden-tests/config/inherit-base-members/copy-dependencies.html index a670b703ef..7020bc924d 100644 --- a/test-files/golden-tests/config/inherit-base-members/copy-dependencies.html +++ b/test-files/golden-tests/config/inherit-base-members/copy-dependencies.html @@ -419,7 +419,7 @@

Synopsis

-

derived::do_excluded_inherited

+

derived::excluded_inherited

This function should be inherited by derived classes. @@ -433,16 +433,16 @@

Synopsis

 
 excluded_base&
-do_excluded_inherited();
+excluded_inherited();
 
 
-

derived::do_shadowed

+

derived::do_excluded_inherited

-This function should be shadowed by derived classes. +This function should be inherited by derived classes.
@@ -454,16 +454,16 @@

Synopsis

 
 excluded_base&
-do_shadowed();
+do_excluded_inherited();
 
 
-

derived::excluded_inherited

+

derived::do_shadowed

-This function should be inherited by derived classes. +This function should be shadowed by derived classes.
@@ -475,7 +475,7 @@

Synopsis

 
 excluded_base&
-excluded_inherited();
+do_shadowed();
 
 
diff --git a/test-files/golden-tests/config/inherit-base-members/copy-dependencies.xml b/test-files/golden-tests/config/inherit-base-members/copy-dependencies.xml index 98861e510a..1bf9b4da39 100644 --- a/test-files/golden-tests/config/inherit-base-members/copy-dependencies.xml +++ b/test-files/golden-tests/config/inherit-base-members/copy-dependencies.xml @@ -214,11 +214,24 @@ - - + + - + + + + + + This function should shadow the base class function. + + + + + + + + @@ -227,8 +240,8 @@ - - + + @@ -236,20 +249,20 @@ - This function should shadow the excluded_base function. + This function should be inherited by derived classes. - - + + - + - This function should shadow the base class function. + This function should shadow the excluded_base function. @@ -292,19 +305,6 @@ - - - - - - - - - - This function should be inherited by derived classes. - - - @@ -354,6 +354,32 @@ Should inherit functions as protected. + + + + + + + + + + This function should shadow the base class function. + + + + + + + + + + + + + This function should shadow the base class function. + + + @@ -393,19 +419,6 @@ - - - - - - - - - - This function should shadow the base class function. - - - @@ -458,19 +471,6 @@ - - - - - - - - - - This function should shadow the base class function. - - - diff --git a/test-files/golden-tests/config/inherit-base-members/copy.adoc b/test-files/golden-tests/config/inherit-base-members/copy.adoc index 079cf487a3..70bb2bb3e3 100644 --- a/test-files/golden-tests/config/inherit-base-members/copy.adoc +++ b/test-files/golden-tests/config/inherit-base-members/copy.adoc @@ -438,8 +438,25 @@ Declared in `<copy.cpp>` do_base_base_inherited(); ---- -[#derived-do_base_inherited] -== <>::do_base_inherited +[#derived-do_derived_shadowed-0a] +== <>::do_derived_shadowed + + +This function should shadow the base class function. + +=== Synopsis + + +Declared in `<copy.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +<>& +do_derived_shadowed(); +---- + +[#derived-excluded_inherited] +== <>::excluded_inherited This function should be inherited by derived classes. @@ -451,15 +468,15 @@ Declared in `<copy.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -<>& -do_base_inherited(); +excluded_base& +excluded_inherited(); ---- -[#derived-do_base_shadowed] -== <>::do_base_shadowed +[#derived-do_base_inherited] +== <>::do_base_inherited -This function should shadow the excluded_base function. +This function should be inherited by derived classes. === Synopsis @@ -469,14 +486,14 @@ Declared in `<copy.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- <>& -do_base_shadowed(); +do_base_inherited(); ---- -[#derived-do_derived_shadowed-0a] -== <>::do_derived_shadowed +[#derived-do_base_shadowed] +== <>::do_base_shadowed -This function should shadow the base class function. +This function should shadow the excluded_base function. === Synopsis @@ -485,8 +502,8 @@ Declared in `<copy.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -<>& -do_derived_shadowed(); +<>& +do_base_shadowed(); ---- [#derived-do_derived_shadowed-0d] @@ -540,23 +557,6 @@ excluded_base& do_shadowed(); ---- -[#derived-excluded_inherited] -== <>::excluded_inherited - - -This function should be inherited by derived classes. - -=== Synopsis - - -Declared in `<copy.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -excluded_base& -excluded_inherited(); ----- - [#private_derived] == private_derived @@ -697,6 +697,40 @@ class protected_derived |=== +[#protected_derived-derived_shadowed-0a] +== <>::derived_shadowed + + +This function should shadow the base class function. + +=== Synopsis + + +Declared in `<copy.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +<>& +derived_shadowed(); +---- + +[#protected_derived-do_derived_shadowed-0e] +== <>::do_derived_shadowed + + +This function should shadow the base class function. + +=== Synopsis + + +Declared in `<copy.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +<>& +do_derived_shadowed(); +---- + [#protected_derived-base_base_inherited] == <>::base_base_inherited @@ -748,23 +782,6 @@ Declared in `<copy.cpp>` base_shadowed(); ---- -[#protected_derived-derived_shadowed-0a] -== <>::derived_shadowed - - -This function should shadow the base class function. - -=== Synopsis - - -Declared in `<copy.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -<>& -derived_shadowed(); ----- - [#protected_derived-derived_shadowed-0f] == <>::derived_shadowed @@ -833,23 +850,6 @@ Declared in `<copy.cpp>` do_base_shadowed(); ---- -[#protected_derived-do_derived_shadowed-0e] -== <>::do_derived_shadowed - - -This function should shadow the base class function. - -=== Synopsis - - -Declared in `<copy.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -<>& -do_derived_shadowed(); ----- - [#protected_derived-do_derived_shadowed-06] == <>::do_derived_shadowed diff --git a/test-files/golden-tests/config/inherit-base-members/copy.html b/test-files/golden-tests/config/inherit-base-members/copy.html index 2b06963d8e..771614b9bc 100644 --- a/test-files/golden-tests/config/inherit-base-members/copy.html +++ b/test-files/golden-tests/config/inherit-base-members/copy.html @@ -524,9 +524,9 @@

Synopsis

-

derived::do_base_inherited

+

derived::do_derived_shadowed

-This function should be inherited by derived classes. +This function should shadow the base class function.
@@ -537,17 +537,17 @@

Synopsis

Declared in <copy.cpp>
 
-base&
-do_base_inherited();
+derived&
+do_derived_shadowed();
 
 
-

derived::do_base_shadowed

+

derived::excluded_inherited

-This function should shadow the excluded_base function. +This function should be inherited by derived classes.
@@ -558,17 +558,17 @@

Synopsis

Declared in <copy.cpp>
 
-base&
-do_base_shadowed();
+excluded_base&
+excluded_inherited();
 
 
-

derived::do_derived_shadowed

+

derived::do_base_inherited

-This function should shadow the base class function. +This function should be inherited by derived classes.
@@ -579,17 +579,17 @@

Synopsis

Declared in <copy.cpp>
 
-derived&
-do_derived_shadowed();
+base&
+do_base_inherited();
 
 
-

derived::do_derived_shadowed

+

derived::do_base_shadowed

-This function should be shadowed by derived classes. +This function should shadow the excluded_base function.
@@ -601,16 +601,16 @@

Synopsis

 
 base&
-do_derived_shadowed();
+do_base_shadowed();
 
 
-

derived::do_excluded_inherited

+

derived::do_derived_shadowed

-This function should be inherited by derived classes. +This function should be shadowed by derived classes.
@@ -621,17 +621,17 @@

Synopsis

Declared in <copy.cpp>
 
-excluded_base&
-do_excluded_inherited();
+base&
+do_derived_shadowed();
 
 
-

derived::do_shadowed

+

derived::do_excluded_inherited

-This function should be shadowed by derived classes. +This function should be inherited by derived classes.
@@ -643,16 +643,16 @@

Synopsis

 
 excluded_base&
-do_shadowed();
+do_excluded_inherited();
 
 
-

derived::excluded_inherited

+

derived::do_shadowed

-This function should be inherited by derived classes. +This function should be shadowed by derived classes.
@@ -664,7 +664,7 @@

Synopsis

 
 excluded_base&
-excluded_inherited();
+do_shadowed();
 
 
@@ -834,9 +834,9 @@

Protected Member Functions

-

protected_derived::base_base_inherited

+

protected_derived::derived_shadowed

-This function should be indirectly inherited by derived classes. +This function should shadow the base class function.
@@ -847,17 +847,17 @@

Synopsis

Declared in <copy.cpp>
 
-base_base&
-base_base_inherited();
+protected_derived&
+derived_shadowed();
 
 
-

protected_derived::base_inherited

+

protected_derived::do_derived_shadowed

-This function should be inherited by derived classes. +This function should shadow the base class function.
@@ -868,17 +868,17 @@

Synopsis

Declared in <copy.cpp>
 
-base&
-base_inherited();
+protected_derived&
+do_derived_shadowed();
 
 
-

protected_derived::base_shadowed

+

protected_derived::base_base_inherited

-This function should shadow the excluded_base function. +This function should be indirectly inherited by derived classes.
@@ -889,17 +889,17 @@

Synopsis

Declared in <copy.cpp>
 
-base&
-base_shadowed();
+base_base&
+base_base_inherited();
 
 
-

protected_derived::derived_shadowed

+

protected_derived::base_inherited

-This function should shadow the base class function. +This function should be inherited by derived classes.
@@ -910,17 +910,17 @@

Synopsis

Declared in <copy.cpp>
 
-protected_derived&
-derived_shadowed();
+base&
+base_inherited();
 
 
-

protected_derived::derived_shadowed

+

protected_derived::base_shadowed

-This function should be shadowed by derived classes. +This function should shadow the excluded_base function.
@@ -932,16 +932,16 @@

Synopsis

 
 base&
-derived_shadowed();
+base_shadowed();
 
 
-

protected_derived::do_base_base_inherited

+

protected_derived::derived_shadowed

-This function should be indirectly inherited by derived classes. +This function should be shadowed by derived classes.
@@ -952,17 +952,17 @@

Synopsis

Declared in <copy.cpp>
 
-base_base&
-do_base_base_inherited();
+base&
+derived_shadowed();
 
 
-

protected_derived::do_base_inherited

+

protected_derived::do_base_base_inherited

-This function should be inherited by derived classes. +This function should be indirectly inherited by derived classes.
@@ -973,17 +973,17 @@

Synopsis

Declared in <copy.cpp>
 
-base&
-do_base_inherited();
+base_base&
+do_base_base_inherited();
 
 
-

protected_derived::do_base_shadowed

+

protected_derived::do_base_inherited

-This function should shadow the excluded_base function. +This function should be inherited by derived classes.
@@ -995,16 +995,16 @@

Synopsis

 
 base&
-do_base_shadowed();
+do_base_inherited();
 
 
-

protected_derived::do_derived_shadowed

+

protected_derived::do_base_shadowed

-This function should shadow the base class function. +This function should shadow the excluded_base function.
@@ -1015,8 +1015,8 @@

Synopsis

Declared in <copy.cpp>
 
-protected_derived&
-do_derived_shadowed();
+base&
+do_base_shadowed();
 
 
diff --git a/test-files/golden-tests/config/inherit-base-members/copy.xml b/test-files/golden-tests/config/inherit-base-members/copy.xml index c61cc8258b..f617ea27da 100644 --- a/test-files/golden-tests/config/inherit-base-members/copy.xml +++ b/test-files/golden-tests/config/inherit-base-members/copy.xml @@ -214,11 +214,24 @@ - - + + - + + + + + + This function should shadow the base class function. + + + + + + + + @@ -227,8 +240,8 @@ - - + + @@ -236,20 +249,20 @@ - This function should shadow the excluded_base function. + This function should be inherited by derived classes. - - + + - + - This function should shadow the base class function. + This function should shadow the excluded_base function. @@ -292,19 +305,6 @@ - - - - - - - - - - This function should be inherited by derived classes. - - -
@@ -354,6 +354,32 @@ Should inherit functions as protected. + + + + + + + + + + This function should shadow the base class function. + + + + + + + + + + + + + This function should shadow the base class function. + + + @@ -393,19 +419,6 @@ - - - - - - - - - - This function should shadow the base class function. - - - @@ -458,19 +471,6 @@ - - - - - - - - - - This function should shadow the base class function. - - - diff --git a/test-files/golden-tests/config/inherit-base-members/reference.xml b/test-files/golden-tests/config/inherit-base-members/reference.xml index a9fc508f89..96d55bcb63 100644 --- a/test-files/golden-tests/config/inherit-base-members/reference.xml +++ b/test-files/golden-tests/config/inherit-base-members/reference.xml @@ -214,21 +214,21 @@ - - + + - + - This function should be inherited by derived classes. + This function should shadow the base class function. - - + + @@ -236,20 +236,20 @@ - This function should shadow the excluded_base function. + This function should be inherited by derived classes. - - + + - + - This function should shadow the base class function. + This function should shadow the excluded_base function. @@ -315,6 +315,32 @@ Should inherit functions as protected. + + + + + + + + + + This function should shadow the base class function. + + + + + + + + + + + + + This function should shadow the base class function. + + + @@ -354,19 +380,6 @@ - - - - - - - - - - This function should shadow the base class function. - - - @@ -419,19 +432,6 @@ - - - - - - - - - - This function should shadow the base class function. - - - diff --git a/test-files/golden-tests/config/sort/sort-members.adoc b/test-files/golden-tests/config/sort/sort-members.adoc new file mode 100644 index 0000000000..71fab1f012 --- /dev/null +++ b/test-files/golden-tests/config/sort/sort-members.adoc @@ -0,0 +1,647 @@ += Reference +:mrdocs: + +[#index] +== Global namespace + + +=== Types + +[cols=1] +|=== +| Name + +| <> +| <> +| <> +| <> +| <> +| <> +| <> +| <> +| <> +|=== +=== Functions + +[cols=1] +|=== +| Name + +| <> +| <> +| <> +| <> +| <> +| <> +|=== + +[#A] +== A + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct A; +---- + + + + +[#B-0b] +== B + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template< + class T, + class U> +struct B; +---- + + + + +[#B-04] +== B<int, char> + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct <><int, char>; +---- + + + + +[#B-05] +== B<int, U> + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class U> +struct <><int, U>; +---- + + + + +[#C-0f] +== C + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template< + class T, + class U = void> +struct C; +---- + + + + +[#C-03] +== C<int> + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct <><int>; +---- + + + + +[#C-0d] +== C<int, char> + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct <><int, char>; +---- + + + + +[#D] +== D + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct D; +---- + + + + +[#Z] +== Z + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct Z; +---- + +=== Member Functions + +[cols=1] +|=== +| Name + +| <> [.small]#[constructor]# +| <> [.small]#[destructor]# +| <> +| <> +| <> +| <> +| <> +| <> +|=== + + + +[#Z-2constructor-00] +== <>::Z + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +<>(); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +<>(int); +---- + +[.small]#<># + +[#Z-2constructor-05] +== <>::Z + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +Z(); +---- + +[#Z-2constructor-06] +== <>::Z + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +Z(int); +---- + +[#Z-2destructor] +== <>::~Z + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +~Z(); +---- + +[#Z-foo] +== <>::foo + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +foo() const; +---- + +[#Z-2conversion] +== <>::operator bool + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +operator bool() const; +---- + +[#Z-operator_not] +== <>::operator! + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator!() const; +---- + +[#Z-operator_eq] +== <>::operator== + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator==(<> const&) const; +---- + +[#Z-operator_not_eq] +== <>::operator!= + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator!=(<> const&) const; +---- + +[#Z-operator_3way] +== <>::operator<=> + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +auto +operator<=>(<> const&) const; +---- + +[#f] +== f + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(); +---- + +[#g-0d] +== g + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +<>(double); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +<>(int); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +<>( + double, + char); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +<>( + char, + char, + char); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class T> +char +<>( + T, + T, + T); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +char +<><int>( + int, + int, + int); +---- + +[.small]#<># + +[#g-0e3] +== g + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +g(); +---- + +[#g-06] +== g + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +g(double); +---- + +[#g-04] +== g + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +g(int); +---- + +[#g-03a] +== g + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +g( + double, + char); +---- + +[#g-0a] +== g + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +g( + char, + char, + char); +---- + +[#g-03c] +== g + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class T> +char +g( + T, + T, + T); +---- + +[#g-0e4] +== g<int> + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +char +<><int>( + int, + int, + int); +---- + +[#h] +== h + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +h(); +---- + +[#operator_not] +== operator! + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator!(<> const& v); +---- + +[#operator_eq] +== operator== + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator==( + <> const& lhs, + <> const& rhs); +---- + +[#operator_not_eq] +== operator!= + + +=== Synopsis + + +Declared in `<sort‐members.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator!=( + <> const& lhs, + <> const& rhs); +---- + + + +[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/sort/sort-members.cpp b/test-files/golden-tests/config/sort/sort-members.cpp new file mode 100644 index 0000000000..c65f3cf8df --- /dev/null +++ b/test-files/golden-tests/config/sort/sort-members.cpp @@ -0,0 +1,60 @@ +struct D {}; + +template +struct C {}; + +template <> +struct C {}; + +template <> +struct C {}; + +template +struct B {}; + +template <> +struct B {}; + +template +struct B {}; + +struct A {}; + +struct Z { + auto operator<=>(Z const&) const; + bool operator!=(Z const&) const; + bool operator==(Z const&) const; + bool operator!() const; + operator bool() const; + void foo() const; + ~Z(); + Z(int); + Z(); +}; + +bool operator!=(A const& lhs, A const& rhs); +bool operator==(A const& lhs, A const& rhs); +bool operator!(A const& v); + +void h(); + +template +char g(T, T, T); + +template <> +char g(int, int, int); + +char g(char, char, char); + +char g(double, char); + +char g(double); + +char g(int); + +char g(int); + +void g(); + +void f(); + diff --git a/test-files/golden-tests/config/sort/sort-members.html b/test-files/golden-tests/config/sort/sort-members.html new file mode 100644 index 0000000000..4b187eaef4 --- /dev/null +++ b/test-files/golden-tests/config/sort/sort-members.html @@ -0,0 +1,683 @@ + + +Reference + + +
+

Reference

+
+
+

Global namespace

+
+

Types

+ + + + + + + + + + + + + + + + + + +
Name
A
B
B<int, char>
B<int, U>
C
C<int>
C<int, char>
D
Z
+

Functions

+ + + + + + + + + + + + + + + +
Name
f
g
h
operator!
operator==
operator!=
+
+
+
+

A

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+struct A;
+
+
+
+ + +
+
+
+

B

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+template<
+    class T,
+    class U>
+struct B;
+
+
+
+ + +
+
+
+

B<int, char>

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+template<>
+struct B<int, char>;
+
+
+
+ + +
+
+
+

B<int, U>

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+template<class U>
+struct B<int, U>;
+
+
+
+ + +
+
+
+

C

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+template<
+    class T,
+    class U = void>
+struct C;
+
+
+
+ + +
+
+
+

C<int>

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+template<>
+struct C<int>;
+
+
+
+ + +
+
+
+

C<int, char>

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+template<>
+struct C<int, char>;
+
+
+
+ + +
+
+
+

D

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+struct D;
+
+
+
+ + +
+
+
+

Z

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+struct Z;
+
+
+
+

Member Functions

+ + + + + + + + + + + + + + + + + +
Name
Z [constructor]
~Z [destructor]
foo
operator bool
operator!
operator==
operator!=
operator<=>
+ + +
+
+
+

Z::Z

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+Z();
+
+
» more... + +
+
+Z(int);
+
+
» more... + + +
+
+
+
+

Z::Z

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+Z();
+
+
+
+
+
+
+

Z::Z

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+Z(int);
+
+
+
+
+
+
+

Z::~Z

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+~Z();
+
+
+
+
+
+
+

Z::foo

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+void
+foo() const;
+
+
+
+
+
+
+

Z::operator bool

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+operator bool() const;
+
+
+
+
+
+
+

Z::operator!

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+bool
+operator!() const;
+
+
+
+
+
+
+

Z::operator==

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+bool
+operator==(Z const&) const;
+
+
+
+
+
+
+

Z::operator!=

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+bool
+operator!=(Z const&) const;
+
+
+
+
+
+
+

Z::operator<=>

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+auto
+operator<=>(Z const&) const;
+
+
+
+
+
+
+

f

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+void
+f();
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+void
+g();
+
+
» more... + +
+
+char
+g(double);
+
+
» more... + +
+
+char
+g(int);
+
+
» more... + +
+
+char
+g(
+    double,
+    char);
+
+
» more... + +
+
+char
+g(
+    char,
+    char,
+    char);
+
+
» more... + +
+
+template<class T>
+char
+g(
+    T,
+    T,
+    T);
+
+
» more... + +
+
+template<>
+char
+g<int>(
+    int,
+    int,
+    int);
+
+
» more... + + +
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+void
+g();
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+char
+g(double);
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+char
+g(int);
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+char
+g(
+    double,
+    char);
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+char
+g(
+    char,
+    char,
+    char);
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+template<class T>
+char
+g(
+    T,
+    T,
+    T);
+
+
+
+
+
+
+

g<int>

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+template<>
+char
+g<int>(
+    int,
+    int,
+    int);
+
+
+
+
+
+
+

h

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+void
+h();
+
+
+
+
+
+
+

operator!

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+bool
+operator!(A const& v);
+
+
+
+
+
+
+

operator==

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+bool
+operator==(
+    A const& lhs,
+    A const& rhs);
+
+
+
+
+
+
+

operator!=

+
+
+

Synopsis

+
+Declared in <sort-members.cpp>
+
+
+bool
+operator!=(
+    A const& lhs,
+    A const& rhs);
+
+
+
+
+ +
+
+

Created with MrDocs

+
+ + \ No newline at end of file diff --git a/test-files/golden-tests/config/sort/sort-members.xml b/test-files/golden-tests/config/sort/sort-members.xml new file mode 100644 index 0000000000..a525afc9ce --- /dev/null +++ b/test-files/golden-tests/config/sort/sort-members.xml @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-files/golden-tests/config/sort/sort-members.yml b/test-files/golden-tests/config/sort/sort-members.yml new file mode 100644 index 0000000000..8cc1c56b3f --- /dev/null +++ b/test-files/golden-tests/config/sort/sort-members.yml @@ -0,0 +1 @@ +sort-members: true \ No newline at end of file diff --git a/test-files/golden-tests/config/sort/unordered.adoc b/test-files/golden-tests/config/sort/unordered.adoc new file mode 100644 index 0000000000..5537654128 --- /dev/null +++ b/test-files/golden-tests/config/sort/unordered.adoc @@ -0,0 +1,647 @@ += Reference +:mrdocs: + +[#index] +== Global namespace + + +=== Types + +[cols=1] +|=== +| Name + +| <> +| <> +| <> +| <> +| <> +| <> +| <> +| <> +| <> +|=== +=== Functions + +[cols=1] +|=== +| Name + +| <> +| <> +| <> +| <> +| <> +| <> +|=== + +[#D] +== D + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct D; +---- + + + + +[#C-0f] +== C + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template< + class T, + class U = void> +struct C; +---- + + + + +[#C-0d] +== C<int, char> + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct <><int, char>; +---- + + + + +[#C-03] +== C<int> + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct <><int>; +---- + + + + +[#B-0b] +== B + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template< + class T, + class U> +struct B; +---- + + + + +[#B-04] +== B<int, char> + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct <><int, char>; +---- + + + + +[#B-05] +== B<int, U> + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class U> +struct <><int, U>; +---- + + + + +[#A] +== A + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct A; +---- + + + + +[#Z] +== Z + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct Z; +---- + +=== Member Functions + +[cols=1] +|=== +| Name + +| <> +| <> +| <> +| <> +| <> +| <> +| <> [.small]#[destructor]# +| <> [.small]#[constructor]# +|=== + + + +[#Z-operator_3way] +== <>::operator<=> + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +auto +operator<=>(<> const&) const; +---- + +[#Z-operator_not_eq] +== <>::operator!= + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator!=(<> const&) const; +---- + +[#Z-operator_eq] +== <>::operator== + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator==(<> const&) const; +---- + +[#Z-operator_not] +== <>::operator! + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator!() const; +---- + +[#Z-2conversion] +== <>::operator bool + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +operator bool() const; +---- + +[#Z-foo] +== <>::foo + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +foo() const; +---- + +[#Z-2destructor] +== <>::~Z + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +~Z(); +---- + +[#Z-2constructor-00] +== <>::Z + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +<>(int); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +<>(); +---- + +[.small]#<># + +[#Z-2constructor-06] +== <>::Z + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +Z(int); +---- + +[#Z-2constructor-05] +== <>::Z + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +Z(); +---- + +[#operator_not_eq] +== operator!= + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator!=( + <> const& lhs, + <> const& rhs); +---- + +[#operator_eq] +== operator== + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator==( + <> const& lhs, + <> const& rhs); +---- + +[#operator_not] +== operator! + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +bool +operator!(<> const& v); +---- + +[#h] +== h + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +h(); +---- + +[#g-0d] +== g + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class T> +char +<>( + T, + T, + T); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +char +<><int>( + int, + int, + int); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +<>( + char, + char, + char); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +<>( + double, + char); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +<>(double); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +<>(int); +---- + +[.small]#<># + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +<>(); +---- + +[.small]#<># + +[#g-03c] +== g + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class T> +char +g( + T, + T, + T); +---- + +[#g-0e4] +== g<int> + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +char +<><int>( + int, + int, + int); +---- + +[#g-0a] +== g + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +g( + char, + char, + char); +---- + +[#g-03a] +== g + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +g( + double, + char); +---- + +[#g-06] +== g + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +g(double); +---- + +[#g-04] +== g + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +char +g(int); +---- + +[#g-0e3] +== g + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +g(); +---- + +[#f] +== f + + +=== Synopsis + + +Declared in `<unordered.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +f(); +---- + + + +[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/config/sort/unordered.cpp b/test-files/golden-tests/config/sort/unordered.cpp new file mode 100644 index 0000000000..c65f3cf8df --- /dev/null +++ b/test-files/golden-tests/config/sort/unordered.cpp @@ -0,0 +1,60 @@ +struct D {}; + +template +struct C {}; + +template <> +struct C {}; + +template <> +struct C {}; + +template +struct B {}; + +template <> +struct B {}; + +template +struct B {}; + +struct A {}; + +struct Z { + auto operator<=>(Z const&) const; + bool operator!=(Z const&) const; + bool operator==(Z const&) const; + bool operator!() const; + operator bool() const; + void foo() const; + ~Z(); + Z(int); + Z(); +}; + +bool operator!=(A const& lhs, A const& rhs); +bool operator==(A const& lhs, A const& rhs); +bool operator!(A const& v); + +void h(); + +template +char g(T, T, T); + +template <> +char g(int, int, int); + +char g(char, char, char); + +char g(double, char); + +char g(double); + +char g(int); + +char g(int); + +void g(); + +void f(); + diff --git a/test-files/golden-tests/config/sort/unordered.html b/test-files/golden-tests/config/sort/unordered.html new file mode 100644 index 0000000000..6c0120d595 --- /dev/null +++ b/test-files/golden-tests/config/sort/unordered.html @@ -0,0 +1,683 @@ + + +Reference + + +
+

Reference

+
+
+

Global namespace

+
+

Types

+ + + + + + + + + + + + + + + + + + +
Name
D
C
C<int, char>
C<int>
B
B<int, char>
B<int, U>
A
Z
+

Functions

+ + + + + + + + + + + + + + + +
Name
operator!=
operator==
operator!
h
g
f
+
+
+
+

D

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+struct D;
+
+
+
+ + +
+
+
+

C

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+template<
+    class T,
+    class U = void>
+struct C;
+
+
+
+ + +
+
+
+

C<int, char>

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+template<>
+struct C<int, char>;
+
+
+
+ + +
+
+
+

C<int>

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+template<>
+struct C<int>;
+
+
+
+ + +
+
+
+

B

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+template<
+    class T,
+    class U>
+struct B;
+
+
+
+ + +
+
+
+

B<int, char>

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+template<>
+struct B<int, char>;
+
+
+
+ + +
+
+
+

B<int, U>

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+template<class U>
+struct B<int, U>;
+
+
+
+ + +
+
+
+

A

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+struct A;
+
+
+
+ + +
+
+
+

Z

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+struct Z;
+
+
+
+

Member Functions

+ + + + + + + + + + + + + + + + + +
Name
operator<=>
operator!=
operator==
operator!
operator bool
foo
~Z [destructor]
Z [constructor]
+ + +
+
+
+

Z::operator<=>

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+auto
+operator<=>(Z const&) const;
+
+
+
+
+
+
+

Z::operator!=

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+bool
+operator!=(Z const&) const;
+
+
+
+
+
+
+

Z::operator==

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+bool
+operator==(Z const&) const;
+
+
+
+
+
+
+

Z::operator!

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+bool
+operator!() const;
+
+
+
+
+
+
+

Z::operator bool

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+operator bool() const;
+
+
+
+
+
+
+

Z::foo

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+void
+foo() const;
+
+
+
+
+
+
+

Z::~Z

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+~Z();
+
+
+
+
+
+
+

Z::Z

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+Z(int);
+
+
» more... + +
+
+Z();
+
+
» more... + + +
+
+
+
+

Z::Z

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+Z(int);
+
+
+
+
+
+
+

Z::Z

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+Z();
+
+
+
+
+
+
+

operator!=

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+bool
+operator!=(
+    A const& lhs,
+    A const& rhs);
+
+
+
+
+
+
+

operator==

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+bool
+operator==(
+    A const& lhs,
+    A const& rhs);
+
+
+
+
+
+
+

operator!

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+bool
+operator!(A const& v);
+
+
+
+
+
+
+

h

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+void
+h();
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+template<class T>
+char
+g(
+    T,
+    T,
+    T);
+
+
» more... + +
+
+template<>
+char
+g<int>(
+    int,
+    int,
+    int);
+
+
» more... + +
+
+char
+g(
+    char,
+    char,
+    char);
+
+
» more... + +
+
+char
+g(
+    double,
+    char);
+
+
» more... + +
+
+char
+g(double);
+
+
» more... + +
+
+char
+g(int);
+
+
» more... + +
+
+void
+g();
+
+
» more... + + +
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+template<class T>
+char
+g(
+    T,
+    T,
+    T);
+
+
+
+
+
+
+

g<int>

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+template<>
+char
+g<int>(
+    int,
+    int,
+    int);
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+char
+g(
+    char,
+    char,
+    char);
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+char
+g(
+    double,
+    char);
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+char
+g(double);
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+char
+g(int);
+
+
+
+
+
+
+

g

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+void
+g();
+
+
+
+
+
+
+

f

+
+
+

Synopsis

+
+Declared in <unordered.cpp>
+
+
+void
+f();
+
+
+
+
+ +
+
+

Created with MrDocs

+
+ + \ No newline at end of file diff --git a/test-files/golden-tests/config/sort/unordered.xml b/test-files/golden-tests/config/sort/unordered.xml new file mode 100644 index 0000000000..9326d67b11 --- /dev/null +++ b/test-files/golden-tests/config/sort/unordered.xml @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-files/golden-tests/config/sort/unordered.yml b/test-files/golden-tests/config/sort/unordered.yml new file mode 100644 index 0000000000..8bd19f7a63 --- /dev/null +++ b/test-files/golden-tests/config/sort/unordered.yml @@ -0,0 +1,6 @@ +sort-members: false +sort-members-ctors-1st: false +sort-members-dtors-1st: false +sort-members-assignment-1st: false +sort-members-conversion-last: false +sort-members-relational-last: false \ No newline at end of file diff --git a/test-files/golden-tests/filters/symbol-name/extraction-mode.adoc b/test-files/golden-tests/filters/symbol-name/extraction-mode.adoc index 36b45d810b..5dea0914e7 100644 --- a/test-files/golden-tests/filters/symbol-name/extraction-mode.adoc +++ b/test-files/golden-tests/filters/symbol-name/extraction-mode.adoc @@ -460,6 +460,61 @@ It's the responsibility of the function documentation to explain the implem +[#dependency_ns_alias] +== dependency_ns_alias + + +Namespace alias to form the dependency on dependency_ns + +=== Synopsis + + +Declared in `<extraction‐mode.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +namespace dependency_ns_alias = dependency_ns; +---- + +[#implementation_defined_ns_alias] +== implementation_defined_ns_alias + + +Namespace alias to form a dependency on the implementation‐defined namespace + +=== Synopsis + + +Declared in `<extraction‐mode.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +namespace implementation_defined_ns_alias = /* implementation-defined */; +---- + +[#see_below_ns_alias] +== see_below_ns_alias + + +Namespace alias to form a dependency on the see‐below namespace + +=== Synopsis + + +Declared in `<extraction‐mode.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +namespace see_below_ns_alias = <>; +---- + +=== Description + + +The alias should be linked as usual and, because it's a namespace, the members should be listed on the page. + + + [#regular] == regular @@ -670,61 +725,6 @@ When used in a function, the symbol name should be shown as usual. The pa -[#dependency_ns_alias] -== dependency_ns_alias - - -Namespace alias to form the dependency on dependency_ns - -=== Synopsis - - -Declared in `<extraction‐mode.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -namespace dependency_ns_alias = dependency_ns; ----- - -[#implementation_defined_ns_alias] -== implementation_defined_ns_alias - - -Namespace alias to form a dependency on the implementation‐defined namespace - -=== Synopsis - - -Declared in `<extraction‐mode.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -namespace implementation_defined_ns_alias = /* implementation-defined */; ----- - -[#see_below_ns_alias] -== see_below_ns_alias - - -Namespace alias to form a dependency on the see‐below namespace - -=== Synopsis - - -Declared in `<extraction‐mode.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -namespace see_below_ns_alias = <>; ----- - -=== Description - - -The alias should be linked as usual and, because it's a namespace, the members should be listed on the page. - - - [.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/filters/symbol-name/extraction-mode.html b/test-files/golden-tests/filters/symbol-name/extraction-mode.html index 9b922a2638..cd16d64e92 100644 --- a/test-files/golden-tests/filters/symbol-name/extraction-mode.html +++ b/test-files/golden-tests/filters/symbol-name/extraction-mode.html @@ -535,6 +535,72 @@

Description

It's the responsibility of the function documentation to explain the implementation-defined symbol.

+ + +
+
+

dependency_ns_alias

+
+Namespace alias to form the dependency on dependency_ns + + +
+
+
+

Synopsis

+
+Declared in <extraction-mode.cpp>
+
+
+namespace dependency_ns_alias = dependency_ns;
+
+
+
+
+
+
+

implementation_defined_ns_alias

+
+Namespace alias to form a dependency on the implementation-defined namespace + + +
+
+
+

Synopsis

+
+Declared in <extraction-mode.cpp>
+
+
+namespace implementation_defined_ns_alias = /* implementation-defined */;
+
+
+
+
+
+
+

see_below_ns_alias

+
+Namespace alias to form a dependency on the see-below namespace + + +
+
+
+

Synopsis

+
+Declared in <extraction-mode.cpp>
+
+
+namespace see_below_ns_alias = see_below_ns;
+
+
+
+
+

Description

+

The alias should be linked as usual and, because it's a namespace, the members should be listed on the page.

+ +
@@ -773,72 +839,6 @@

Description

When used in a function, the symbol name should be shown as usual. The page for this symbol is what should be different because the synopsis should say "See below" and the members are not listed unless it's a namespace or the symbol has been explicitly used as a dependency elsewhere.

-
- -
-
-

dependency_ns_alias

-
-Namespace alias to form the dependency on dependency_ns - - -
-
-
-

Synopsis

-
-Declared in <extraction-mode.cpp>
-
-
-namespace dependency_ns_alias = dependency_ns;
-
-
-
-
-
-
-

implementation_defined_ns_alias

-
-Namespace alias to form a dependency on the implementation-defined namespace - - -
-
-
-

Synopsis

-
-Declared in <extraction-mode.cpp>
-
-
-namespace implementation_defined_ns_alias = /* implementation-defined */;
-
-
-
-
-
-
-

see_below_ns_alias

-
-Namespace alias to form a dependency on the see-below namespace - - -
-
-
-

Synopsis

-
-Declared in <extraction-mode.cpp>
-
-
-namespace see_below_ns_alias = see_below_ns;
-
-
-
-
-

Description

-

The alias should be linked as usual and, because it's a namespace, the members should be listed on the page.

- -
diff --git a/test-files/golden-tests/filters/symbol-name/extraction-mode.xml b/test-files/golden-tests/filters/symbol-name/extraction-mode.xml index 2300ed720a..2a0f946992 100644 --- a/test-files/golden-tests/filters/symbol-name/extraction-mode.xml +++ b/test-files/golden-tests/filters/symbol-name/extraction-mode.xml @@ -217,6 +217,36 @@
+ + + + + Namespace alias to form the dependency on dependency_ns + + + + + + + + + Namespace alias to form a dependency on the implementation-defined namespace + + + + + + + + + Namespace alias to form a dependency on the see-below namespace + + + The alias should be linked as usual and, because it's a namespace, the members should be listed on the page. + + + + @@ -330,35 +360,5 @@
- - - - - Namespace alias to form the dependency on dependency_ns - - - - - - - - - Namespace alias to form a dependency on the implementation-defined namespace - - - - - - - - - Namespace alias to form a dependency on the see-below namespace - - - The alias should be linked as usual and, because it's a namespace, the members should be listed on the page. - - - -
diff --git a/test-files/golden-tests/javadoc/brief/brief-3.adoc b/test-files/golden-tests/javadoc/brief/brief-3.adoc index 8899566156..eca2988c98 100644 --- a/test-files/golden-tests/javadoc/brief/brief-3.adoc +++ b/test-files/golden-tests/javadoc/brief/brief-3.adoc @@ -26,26 +26,26 @@ Declared in `<brief‐3.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -<>(int); +<>(double); ---- -[.small]#<># +[.small]#<># [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -<>(char const*); +<>(int); ---- -[.small]#<># +[.small]#<># [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -<>(double); +<>(char const*); ---- -[.small]#<># +[.small]#<># [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- @@ -55,7 +55,7 @@ void [.small]#<># -[#f-06] +[#f-0f] == f @@ -69,21 +69,14 @@ Declared in `<brief‐3.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -f(int); +f(double); ---- -=== Description - - -More info - - - -[#f-07] +[#f-06] == f -C string overload. +Integer overload. === Synopsis @@ -93,7 +86,7 @@ Declared in `<brief‐3.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -f(char const*); +f(int); ---- === Description @@ -103,11 +96,11 @@ More info -[#f-0f] +[#f-07] == f -Integer overload. +C string overload. === Synopsis @@ -117,9 +110,16 @@ Declared in `<brief‐3.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -f(double); +f(char const*); ---- +=== Description + + +More info + + + [#f-0b] == f diff --git a/test-files/golden-tests/javadoc/brief/brief-3.html b/test-files/golden-tests/javadoc/brief/brief-3.html index 9f3b73e75d..e3ed536e5b 100644 --- a/test-files/golden-tests/javadoc/brief/brief-3.html +++ b/test-files/golden-tests/javadoc/brief/brief-3.html @@ -33,23 +33,23 @@

Synopsis

 
 void
-f(int);
+f(double);
 
-
» more... +» more...
 
 void
-f(char const*);
+f(int);
 
-
» more... +» more...
 
 void
-f(double);
+f(char const*);
 
-
» more... +» more...
 
@@ -63,7 +63,7 @@ 

Synopsis

-

f

+

f

Integer overload. @@ -77,22 +77,16 @@

Synopsis

 
 void
-f(int);
+f(double);
 
 
-
-
-

Description

-

More info

- -
-

f

+

f

-C string overload. +Integer overload.
@@ -104,7 +98,7 @@

Synopsis

 
 void
-f(char const*);
+f(int);
 
 
@@ -117,9 +111,9 @@

Description

-

f

+

f

-Integer overload. +C string overload.
@@ -131,9 +125,15 @@

Synopsis

 
 void
-f(double);
+f(char const*);
 
 
+
+
+

Description

+

More info

+ +
diff --git a/test-files/golden-tests/javadoc/brief/brief-3.xml b/test-files/golden-tests/javadoc/brief/brief-3.xml index 3e384f84b2..045c163f13 100644 --- a/test-files/golden-tests/javadoc/brief/brief-3.xml +++ b/test-files/golden-tests/javadoc/brief/brief-3.xml @@ -2,6 +2,17 @@ + + + + + + + + Integer overload. + + + @@ -32,17 +43,6 @@
- - - - - - - - Integer overload. - - - diff --git a/test-files/golden-tests/javadoc/ref/ref.adoc b/test-files/golden-tests/javadoc/ref/ref.adoc index 5d2b284879..cdf5b57692 100644 --- a/test-files/golden-tests/javadoc/ref/ref.adoc +++ b/test-files/golden-tests/javadoc/ref/ref.adoc @@ -301,8 +301,7 @@ struct F; |=== | Name -| <> -| <> +| <> | <> | <> | <> @@ -322,15 +321,8 @@ struct F; | <> | <> | <> -| <> | <> | <> -| <> -| <> -| <> -| <> -| <> -| <> | <> | <> | <> @@ -340,27 +332,20 @@ struct F; | <> | <> | <> +| <> +| <> +| <> +| <> +| <> +| <> +| <> +| <> |=== -[#F-operator_not] -== <>::operator! - - -=== Synopsis - - -Declared in `<ref.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -void -operator!(); ----- - -[#F-operator_not_eq] -== <>::operator!= +[#F-operator_assign] +== <>::operator= === Synopsis @@ -371,7 +356,7 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator!=(<>&); +operator=(<>&); ---- [#F-operator_mod] @@ -659,8 +644,8 @@ void operator/=(<>&); ---- -[#F-operator_lt] -== <>::operator< +[#F-operator_lshift] +== <>::operator<< === Synopsis @@ -671,11 +656,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator<(<>&); +operator<<(<>&); ---- -[#F-operator_lshift] -== <>::operator<< +[#F-operator_lshift_eq] +== <>::operator<<= === Synopsis @@ -686,11 +671,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator<<(<>&); +operator<<=(<>&); ---- -[#F-operator_lshift_eq] -== <>::operator<<= +[#F-operator_rshift] +== <>::operator>> === Synopsis @@ -701,11 +686,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator<<=(<>&); +operator>>(<>&); ---- -[#F-operator_le] -== <>::operator<= +[#F-operator_rshift_eq] +== <>::operator>>= === Synopsis @@ -716,11 +701,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator<=(<>&); +operator>>=(<>&); ---- -[#F-operator_3way] -== <>::operator<=> +[#F-operator_subs] +== <>::operator[] === Synopsis @@ -731,11 +716,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator<=>(<>&); +operator[](<>&); ---- -[#F-operator_assign] -== <>::operator= +[#F-operator_xor] +== <>::operatorˆ === Synopsis @@ -746,11 +731,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator=(<>&); +operatorˆ(<>&); ---- -[#F-operator_eq] -== <>::operator== +[#F-operator_xor_eq] +== <>::operatorˆ= === Synopsis @@ -761,11 +746,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator==(<>&); +operatorˆ=(<>&); ---- -[#F-operator_gt] -== <>::operator> +[#F-operator_bitor] +== <>::operator| === Synopsis @@ -776,11 +761,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator>(<>&); +operator|(<>&); ---- -[#F-operator_ge] -== <>::operator>= +[#F-operator_or_eq] +== <>::operator|= === Synopsis @@ -791,11 +776,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator>=(<>&); +operator|=(<>&); ---- -[#F-operator_rshift] -== <>::operator>> +[#F-operator_or] +== <>::operator|| === Synopsis @@ -806,11 +791,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator>>(<>&); +operator||(<>&); ---- -[#F-operator_rshift_eq] -== <>::operator>>= +[#F-operator_bitnot] +== <>::operator~ === Synopsis @@ -821,11 +806,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator>>=(<>&); +operator~(); ---- -[#F-operator_subs] -== <>::operator[] +[#F-operator_not] +== <>::operator! === Synopsis @@ -836,11 +821,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator[](<>&); +operator!(); ---- -[#F-operator_xor] -== <>::operatorˆ +[#F-operator_eq] +== <>::operator== === Synopsis @@ -851,11 +836,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operatorˆ(<>&); +operator==(<>&); ---- -[#F-operator_xor_eq] -== <>::operatorˆ= +[#F-operator_not_eq] +== <>::operator!= === Synopsis @@ -866,11 +851,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operatorˆ=(<>&); +operator!=(<>&); ---- -[#F-operator_bitor] -== <>::operator| +[#F-operator_lt] +== <>::operator< === Synopsis @@ -881,11 +866,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator|(<>&); +operator<(<>&); ---- -[#F-operator_or_eq] -== <>::operator|= +[#F-operator_le] +== <>::operator<= === Synopsis @@ -896,11 +881,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator|=(<>&); +operator<=(<>&); ---- -[#F-operator_or] -== <>::operator|| +[#F-operator_gt] +== <>::operator> === Synopsis @@ -911,11 +896,11 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator||(<>&); +operator>(<>&); ---- -[#F-operator_bitnot] -== <>::operator~ +[#F-operator_ge] +== <>::operator>= === Synopsis @@ -926,7 +911,22 @@ Declared in `<ref.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -operator~(); +operator>=(<>&); +---- + +[#F-operator_3way] +== <>::operator<=> + + +=== Synopsis + + +Declared in `<ref.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +operator<=>(<>&); ---- [#f0] diff --git a/test-files/golden-tests/javadoc/ref/ref.html b/test-files/golden-tests/javadoc/ref/ref.html index 180f6b8559..0482c7bd1a 100644 --- a/test-files/golden-tests/javadoc/ref/ref.html +++ b/test-files/golden-tests/javadoc/ref/ref.html @@ -350,8 +350,7 @@

Member Functions

-operator! -operator!= +operator= operator% operator%= operator& @@ -371,15 +370,8 @@

Member Functions

operator->* operator/ operator/= -operator< operator<< operator<<= -operator<= -operator<=> -operator= -operator== -operator> -operator>= operator>> operator>>= operator[] @@ -388,7 +380,15 @@

Member Functions

operator| operator|= operator|| -operator~ +operator~ +operator! +operator== +operator!= +operator< +operator<= +operator> +operator>= +operator<=> @@ -396,23 +396,7 @@

Member Functions

-

F::operator!

-
-
-

Synopsis

-
-Declared in <ref.cpp>
-
-
-void
-operator!();
-
-
-
-
-
-
-

F::operator!=

+

F::operator=

Synopsis

@@ -421,7 +405,7 @@

Synopsis

 
 void
-operator!=(F&);
+operator=(F&);
 
 
@@ -732,7 +716,7 @@

Synopsis

-

F::operator<

+

F::operator<<

Synopsis

@@ -741,14 +725,14 @@

Synopsis

 
 void
-operator<(F&);
+operator<<(F&);
 
 
-

F::operator<<

+

F::operator<<=

Synopsis

@@ -757,14 +741,14 @@

Synopsis

 
 void
-operator<<(F&);
+operator<<=(F&);
 
 
-

F::operator<<=

+

F::operator>>

Synopsis

@@ -773,14 +757,14 @@

Synopsis

 
 void
-operator<<=(F&);
+operator>>(F&);
 
 
-

F::operator<=

+

F::operator>>=

Synopsis

@@ -789,14 +773,14 @@

Synopsis

 
 void
-operator<=(F&);
+operator>>=(F&);
 
 
-

F::operator<=>

+

F::operator[]

Synopsis

@@ -805,14 +789,14 @@

Synopsis

 
 void
-operator<=>(F&);
+operator[](F&);
 
 
-

F::operator=

+

F::operator^

Synopsis

@@ -821,14 +805,14 @@

Synopsis

 
 void
-operator=(F&);
+operator^(F&);
 
 
-

F::operator==

+

F::operator^=

Synopsis

@@ -837,14 +821,14 @@

Synopsis

 
 void
-operator==(F&);
+operator^=(F&);
 
 
-

F::operator>

+

F::operator|

Synopsis

@@ -853,14 +837,14 @@

Synopsis

 
 void
-operator>(F&);
+operator|(F&);
 
 
-

F::operator>=

+

F::operator|=

Synopsis

@@ -869,14 +853,14 @@

Synopsis

 
 void
-operator>=(F&);
+operator|=(F&);
 
 
-

F::operator>>

+

F::operator||

Synopsis

@@ -885,14 +869,14 @@

Synopsis

 
 void
-operator>>(F&);
+operator||(F&);
 
 
-

F::operator>>=

+

F::operator~

Synopsis

@@ -901,14 +885,14 @@

Synopsis

 
 void
-operator>>=(F&);
+operator~();
 
 
-

F::operator[]

+

F::operator!

Synopsis

@@ -917,14 +901,14 @@

Synopsis

 
 void
-operator[](F&);
+operator!();
 
 
-

F::operator^

+

F::operator==

Synopsis

@@ -933,14 +917,14 @@

Synopsis

 
 void
-operator^(F&);
+operator==(F&);
 
 
-

F::operator^=

+

F::operator!=

Synopsis

@@ -949,14 +933,14 @@

Synopsis

 
 void
-operator^=(F&);
+operator!=(F&);
 
 
-

F::operator|

+

F::operator<

Synopsis

@@ -965,14 +949,14 @@

Synopsis

 
 void
-operator|(F&);
+operator<(F&);
 
 
-

F::operator|=

+

F::operator<=

Synopsis

@@ -981,14 +965,14 @@

Synopsis

 
 void
-operator|=(F&);
+operator<=(F&);
 
 
-

F::operator||

+

F::operator>

Synopsis

@@ -997,14 +981,14 @@

Synopsis

 
 void
-operator||(F&);
+operator>(F&);
 
 
-

F::operator~

+

F::operator>=

Synopsis

@@ -1013,7 +997,23 @@

Synopsis

 
 void
-operator~();
+operator>=(F&);
+
+
+
+
+
+
+

F::operator<=>

+
+
+

Synopsis

+
+Declared in <ref.cpp>
+
+
+void
+operator<=>(F&);
 
 
diff --git a/test-files/golden-tests/javadoc/ref/ref.xml b/test-files/golden-tests/javadoc/ref/ref.xml index 35132d96c4..cd030bc124 100644 --- a/test-files/golden-tests/javadoc/ref/ref.xml +++ b/test-files/golden-tests/javadoc/ref/ref.xml @@ -83,13 +83,9 @@ - - - - - - - + + + @@ -107,7 +103,7 @@ - + @@ -134,7 +130,7 @@ - + @@ -161,7 +157,7 @@ - + @@ -183,7 +179,7 @@ - + @@ -214,7 +210,7 @@ - + @@ -245,170 +241,174 @@ - + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + + + + + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - diff --git a/test-files/golden-tests/metadata/alias-template.adoc b/test-files/golden-tests/metadata/alias-template.adoc index eb31304aa1..6420197682 100644 --- a/test-files/golden-tests/metadata/alias-template.adoc +++ b/test-files/golden-tests/metadata/alias-template.adoc @@ -13,10 +13,25 @@ | <> | <> -| <> | <> +| <> |=== +[#C] +== C + + +=== Synopsis + + +Declared in `<alias‐template.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<typename T> +using C = <><T>; +---- + [#A] == A @@ -96,21 +111,6 @@ template<typename U> using E = <><T, U>; ---- -[#C] -== C - - -=== Synopsis - - -Declared in `<alias‐template.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -template<typename T> -using C = <><T>; ----- - [.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/metadata/alias-template.html b/test-files/golden-tests/metadata/alias-template.html index c2c7384c44..19d2785d23 100644 --- a/test-files/golden-tests/metadata/alias-template.html +++ b/test-files/golden-tests/metadata/alias-template.html @@ -20,13 +20,29 @@

Types

A B -C -D +D +C
+

C

+
+
+

Synopsis

+
+Declared in <alias-template.cpp>
+
+
+template<typename T>
+using C = A<T>;
+
+
+
+
+
+

A

@@ -109,22 +125,6 @@

Synopsis

-
-
-

C

-
-
-

Synopsis

-
-Declared in <alias-template.cpp>
-
-
-template<typename T>
-using C = A<T>;
-
-
-
-
diff --git a/test-files/golden-tests/metadata/alias-template.xml b/test-files/golden-tests/metadata/alias-template.xml index fa94e7a18a..0a502a6a49 100644 --- a/test-files/golden-tests/metadata/alias-template.xml +++ b/test-files/golden-tests/metadata/alias-template.xml @@ -2,6 +2,13 @@ + - diff --git a/test-files/golden-tests/metadata/class-template-partial-spec.adoc b/test-files/golden-tests/metadata/class-template-partial-spec.adoc index 601e904151..b2c8d067e3 100644 --- a/test-files/golden-tests/metadata/class-template-partial-spec.adoc +++ b/test-files/golden-tests/metadata/class-template-partial-spec.adoc @@ -36,8 +36,8 @@ struct A; | Name | <> -| <> | <> +| <> |=== @@ -62,8 +62,8 @@ struct B; -[#A-B-06] -== <>::B<U*, T> +[#A-B-04] +== <>::B<T, long> === Synopsis @@ -73,15 +73,15 @@ Declared in `<class‐template‐partial‐spec.cpp> [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -template<typename U> -struct <><U*, T>; +template<> +struct <><T, long>; ---- -[#A-B-04] -== <>::B<T, long> +[#A-B-06] +== <>::B<U*, T> === Synopsis @@ -91,8 +91,8 @@ Declared in `<class‐template‐partial‐spec.cpp> [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -template<> -struct <><T, long>; +template<typename U> +struct <><U*, T>; ---- diff --git a/test-files/golden-tests/metadata/class-template-partial-spec.html b/test-files/golden-tests/metadata/class-template-partial-spec.html index 669e55771e..3c5786a93d 100644 --- a/test-files/golden-tests/metadata/class-template-partial-spec.html +++ b/test-files/golden-tests/metadata/class-template-partial-spec.html @@ -47,8 +47,8 @@

Types

B -B<U*, T> -B<T, long> +B<T, long> +B<U*, T> @@ -76,7 +76,7 @@

Synopsis

-

A::B<U*, T>

+

A::B<T, long>

Synopsis

@@ -84,8 +84,8 @@

Synopsis

Declared in <class-template-partial-spec.cpp>
 
-template<typename U>
-struct B<U*, T>;
+template<>
+struct B<T, long>;
 
 
@@ -94,7 +94,7 @@

Synopsis

-

A::B<T, long>

+

A::B<U*, T>

Synopsis

@@ -102,8 +102,8 @@

Synopsis

Declared in <class-template-partial-spec.cpp>
 
-template<>
-struct B<T, long>;
+template<typename U>
+struct B<U*, T>;
 
 
diff --git a/test-files/golden-tests/metadata/class-template-partial-spec.xml b/test-files/golden-tests/metadata/class-template-partial-spec.xml index 3dca89c28a..5faa2e2b7c 100644 --- a/test-files/golden-tests/metadata/class-template-partial-spec.xml +++ b/test-files/golden-tests/metadata/class-template-partial-spec.xml @@ -13,6 +13,13 @@ + - diff --git a/test-files/golden-tests/metadata/class-template-spec.adoc b/test-files/golden-tests/metadata/class-template-spec.adoc index b724b382ab..748add1f4f 100644 --- a/test-files/golden-tests/metadata/class-template-spec.adoc +++ b/test-files/golden-tests/metadata/class-template-spec.adoc @@ -15,8 +15,8 @@ | <> | <> | <> -| <> | <> +| <> | <> | <> | <> @@ -186,8 +186,8 @@ void f(); ---- -[#B-07] -== B<T*> +[#B-06] +== B<T&> === Synopsis @@ -198,7 +198,7 @@ Declared in `<class‐template‐spec.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> -struct <><T*>; +struct <><T&>; ---- === Member Functions @@ -207,13 +207,13 @@ struct <><T*>; |=== | Name -| <> +| <> |=== -[#B-07-g] -== <><T*>::g +[#B-06-h] +== <><T&>::h === Synopsis @@ -224,11 +224,11 @@ Declared in `<class‐template‐spec.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -g(); +h(); ---- -[#B-06] -== B<T&> +[#B-07] +== B<T*> === Synopsis @@ -239,7 +239,7 @@ Declared in `<class‐template‐spec.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> -struct <><T&>; +struct <><T*>; ---- === Member Functions @@ -248,13 +248,13 @@ struct <><T&>; |=== | Name -| <> +| <> |=== -[#B-06-h] -== <><T&>::h +[#B-07-g] +== <><T*>::g === Synopsis @@ -265,7 +265,7 @@ Declared in `<class‐template‐spec.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -h(); +g(); ---- [#C-0f] diff --git a/test-files/golden-tests/metadata/class-template-spec.html b/test-files/golden-tests/metadata/class-template-spec.html index 22782bc39b..d1be7000c3 100644 --- a/test-files/golden-tests/metadata/class-template-spec.html +++ b/test-files/golden-tests/metadata/class-template-spec.html @@ -22,8 +22,8 @@

Types

A<int> A<long> B -B<T*> B<T&> +B<T*> C C<int, int> C<T*, int> @@ -216,7 +216,7 @@

Synopsis

-

B<T*>

+

B<T&>

Synopsis

@@ -225,7 +225,7 @@

Synopsis

 
 template<typename T>
-struct B<T*>;
+struct B<T&>;
 
 
@@ -238,7 +238,7 @@

Member Functions

-g +h @@ -246,7 +246,7 @@

Member Functions

-

B<T*>::g

+

B<T&>::h

Synopsis

@@ -255,14 +255,14 @@

Synopsis

 
 void
-g();
+h();
 
 
-

B<T&>

+

B<T*>

Synopsis

@@ -271,7 +271,7 @@

Synopsis

 
 template<typename T>
-struct B<T&>;
+struct B<T*>;
 
 
@@ -284,7 +284,7 @@

Member Functions

-h +g @@ -292,7 +292,7 @@

Member Functions

-

B<T&>::h

+

B<T*>::g

Synopsis

@@ -301,7 +301,7 @@

Synopsis

 
 void
-h();
+g();
 
 
diff --git a/test-files/golden-tests/metadata/class-template-spec.xml b/test-files/golden-tests/metadata/class-template-spec.xml index 30438ee9a7..4517512a1b 100644 --- a/test-files/golden-tests/metadata/class-template-spec.xml +++ b/test-files/golden-tests/metadata/class-template-spec.xml @@ -38,16 +38,6 @@ - + - - - - - + - @@ -1129,6 +951,26 @@ + + - @@ -1264,6 +1106,13 @@ + - @@ -1293,6 +1135,36 @@ + + - @@ -1537,6 +1409,41 @@ + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + diff --git a/test-files/golden-tests/metadata/class-template-specializations-2.adoc b/test-files/golden-tests/metadata/class-template-specializations-2.adoc index face17dd1d..fb2d793bc5 100644 --- a/test-files/golden-tests/metadata/class-template-specializations-2.adoc +++ b/test-files/golden-tests/metadata/class-template-specializations-2.adoc @@ -12,9 +12,9 @@ | Name | <> -| <> | <> | <> +| <> |=== [#A-0e] @@ -35,113 +35,6 @@ struct A; -[#A-03] -== A<T*> - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐2.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -template<typename T> -struct <><T*>; ----- - -=== Types - -[cols=1] -|=== -| Name - -| <> -| <> -| <> -|=== - - - -[#A-03-B-05] -== <><T*>::B - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐2.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -template<typename U> -struct B; ----- - - - - -[#A-03-B-01] -== <><T*>::B<U*> - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐2.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -template<typename U> -struct <><U*>; ----- - -=== Types - -[cols=1] -|=== -| Name - -| <> -|=== - - - -[#A-03-B-01-C] -== <><T*>::<><U*>::C - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐2.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -struct C; ----- - - - - -[#A-03-B-0b] -== <><T*>::B<int> - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐2.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -template<> -struct <><int>; ----- - - - - [#A-06] == A<double> @@ -516,6 +409,113 @@ struct C; +[#A-03] +== A<T*> + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐2.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<typename T> +struct <><T*>; +---- + +=== Types + +[cols=1] +|=== +| Name + +| <> +| <> +| <> +|=== + + + +[#A-03-B-05] +== <><T*>::B + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐2.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<typename U> +struct B; +---- + + + + +[#A-03-B-0b] +== <><T*>::B<int> + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐2.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct <><int>; +---- + + + + +[#A-03-B-01] +== <><T*>::B<U*> + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐2.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<typename U> +struct <><U*>; +---- + +=== Types + +[cols=1] +|=== +| Name + +| <> +|=== + + + +[#A-03-B-01-C] +== <><T*>::<><U*>::C + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐2.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct C; +---- + + + + [.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/metadata/class-template-specializations-2.html b/test-files/golden-tests/metadata/class-template-specializations-2.html index a4baeb645e..29ee0f02a9 100644 --- a/test-files/golden-tests/metadata/class-template-specializations-2.html +++ b/test-files/golden-tests/metadata/class-template-specializations-2.html @@ -19,9 +19,9 @@

Types

A -A<T*> A<double> -A<long*> +A<long*> +A<T*>
@@ -45,7 +45,7 @@

Synopsis

-

A<T*>

+

A<double>

Synopsis

@@ -53,8 +53,8 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<typename T>
-struct A<T*>;
+template<>
+struct A<double>;
 
 
@@ -67,9 +67,9 @@

Types

-B -B<U*> -B<int> +D +D<float> +D<short> @@ -77,7 +77,7 @@

Types

-

A<T*>::B

+

A<double>::D

Synopsis

@@ -86,16 +86,29 @@

Synopsis

 
 template<typename U>
-struct B;
+struct D;
 
 
+

Types

+ + + + + + + + + + + +
Name
E
E<T*>
-

A<T*>::B<U*>

+

A<double>::D::E

Synopsis

@@ -103,29 +116,17 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<typename U>
-struct B<U*>;
+template<typename T>
+struct E;
 
 
-

Types

- - - - - - - - - - -
Name
C
-

A<T*>::B<U*>::C

+

A<double>::D::E<T*>

Synopsis

@@ -133,16 +134,29 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-struct C;
+template<typename T>
+struct E<T*>;
 
 
+

Types

+ + + + + + + + + + +
Name
F
-

A<T*>::B<int>

+

A<double>::D::E<T*>::F

Synopsis

@@ -150,8 +164,7 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<>
-struct B<int>;
+struct F;
 
 
@@ -160,7 +173,7 @@

Synopsis

-

A<double>

+

A<double>::D<float>

Synopsis

@@ -169,7 +182,7 @@

Synopsis

 
 template<>
-struct A<double>;
+struct D<float>;
 
 
@@ -182,9 +195,8 @@

Types

-D -D<float> -D<short> +G +G<T*> @@ -192,7 +204,7 @@

Types

-

A<double>::D

+

A<double>::D<float>::G

Synopsis

@@ -200,30 +212,17 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<typename U>
-struct D;
+template<typename T>
+struct G;
 
 
-

Types

- - - - - - - - - - - -
Name
E
E<T*>
-

A<double>::D::E

+

A<double>::D<float>::G<T*>

Synopsis

@@ -232,7 +231,7 @@

Synopsis

 
 template<typename T>
-struct E;
+struct G<T*>;
 
 
@@ -241,7 +240,7 @@

Synopsis

-

A<double>::D::E<T*>

+

A<double>::D<short>

Synopsis

@@ -249,8 +248,8 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<typename T>
-struct E<T*>;
+template<>
+struct D<short>;
 
 
@@ -263,7 +262,8 @@

Types

-F +E +E<int*> @@ -271,7 +271,7 @@

Types

-

A<double>::D::E<T*>::F

+

A<double>::D<short>::E

Synopsis

@@ -279,7 +279,8 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-struct F;
+template<typename T>
+struct E;
 
 
@@ -288,7 +289,7 @@

Synopsis

-

A<double>::D<float>

+

A<double>::D<short>::E<int*>

Synopsis

@@ -297,7 +298,7 @@

Synopsis

 
 template<>
-struct D<float>;
+struct E<int*>;
 
 
@@ -310,8 +311,7 @@

Types

-G -G<T*> +F @@ -319,7 +319,7 @@

Types

-

A<double>::D<float>::G

+

A<double>::D<short>::E<int*>::F

Synopsis

@@ -327,8 +327,7 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<typename T>
-struct G;
+struct F;
 
 
@@ -337,7 +336,7 @@

Synopsis

-

A<double>::D<float>::G<T*>

+

A<long*>

Synopsis

@@ -345,17 +344,31 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<typename T>
-struct G<T*>;
+template<>
+struct A<long*>;
 
 
+

Types

+ + + + + + + + + + + + +
Name
B
B<int>
B<int*>
-

A<double>::D<short>

+

A<long*>::B

Synopsis

@@ -363,30 +376,17 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<>
-struct D<short>;
+template<typename U>
+struct B;
 
 
-

Types

- - - - - - - - - - - -
Name
E
E<int*>
-

A<double>::D<short>::E

+

A<long*>::B<int>

Synopsis

@@ -394,8 +394,8 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<typename T>
-struct E;
+template<>
+struct B<int>;
 
 
@@ -404,7 +404,7 @@

Synopsis

-

A<double>::D<short>::E<int*>

+

A<long*>::B<int*>

Synopsis

@@ -413,7 +413,7 @@

Synopsis

 
 template<>
-struct E<int*>;
+struct B<int*>;
 
 
@@ -426,7 +426,7 @@

Types

-F +C @@ -434,7 +434,7 @@

Types

-

A<double>::D<short>::E<int*>::F

+

A<long*>::B<int*>::C

Synopsis

@@ -442,7 +442,7 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-struct F;
+struct C;
 
 
@@ -451,7 +451,7 @@

Synopsis

-

A<long*>

+

A<T*>

Synopsis

@@ -459,8 +459,8 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<>
-struct A<long*>;
+template<typename T>
+struct A<T*>;
 
 
@@ -473,9 +473,9 @@

Types

-B -B<int> -B<int*> +B +B<int> +B<U*> @@ -483,7 +483,7 @@

Types

-

A<long*>::B

+

A<T*>::B

Synopsis

@@ -501,7 +501,7 @@

Synopsis

-

A<long*>::B<int>

+

A<T*>::B<int>

Synopsis

@@ -519,7 +519,7 @@

Synopsis

-

A<long*>::B<int*>

+

A<T*>::B<U*>

Synopsis

@@ -527,8 +527,8 @@

Synopsis

Declared in <class-template-specializations-2.cpp>
 
-template<>
-struct B<int*>;
+template<typename U>
+struct B<U*>;
 
 
@@ -541,7 +541,7 @@

Types

-C +C @@ -549,7 +549,7 @@

Types

-

A<long*>::B<int*>::C

+

A<T*>::B<U*>::C

Synopsis

diff --git a/test-files/golden-tests/metadata/class-template-specializations-2.xml b/test-files/golden-tests/metadata/class-template-specializations-2.xml index 096c1a89e7..68dc4c1992 100644 --- a/test-files/golden-tests/metadata/class-template-specializations-2.xml +++ b/test-files/golden-tests/metadata/class-template-specializations-2.xml @@ -8,35 +8,6 @@ - + diff --git a/test-files/golden-tests/metadata/class-template-specializations-3.adoc b/test-files/golden-tests/metadata/class-template-specializations-3.adoc index d06ae09dfb..2a5ec30536 100644 --- a/test-files/golden-tests/metadata/class-template-specializations-3.adoc +++ b/test-files/golden-tests/metadata/class-template-specializations-3.adoc @@ -12,9 +12,9 @@ | Name | <> +| <> | <> | <> -| <> | <> | <> |=== @@ -208,6 +208,132 @@ struct <><bool>; +[#A-01] +== A<float> + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐3.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct <><float>; +---- + +=== Types + +[cols=1] +|=== +| Name + +| <> +| <> +|=== + + + +[#A-01-B-07] +== <><float>::B + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐3.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<typename U> +struct B; +---- + + + + +[#A-01-B-08] +== <><float>::B<double, double> + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐3.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct <><double, double>; +---- + +=== Types + +[cols=1] +|=== +| Name + +| <> +| <> +| <> +|=== + + + +[#A-01-B-08-C] +== <><float>::<><double, double>::C + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐3.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +struct C; +---- + + + + +[#A-01-B-08-D-0ae] +== <><float>::<><double, double>::D + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐3.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<typename V> +struct D; +---- + + + + +[#A-01-B-08-D-0af] +== <><float>::<><double, double>::D<bool, bool> + + +=== Synopsis + + +Declared in `<class‐template‐specializations‐3.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct <><bool, bool>; +---- + + + + [#A-0c] == A<long> @@ -687,132 +813,6 @@ struct <><bool>; -[#A-01] -== A<float> - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐3.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -template<> -struct <><float>; ----- - -=== Types - -[cols=1] -|=== -| Name - -| <> -| <> -|=== - - - -[#A-01-B-07] -== <><float>::B - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐3.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -template<typename U> -struct B; ----- - - - - -[#A-01-B-08] -== <><float>::B<double, double> - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐3.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -template<> -struct <><double, double>; ----- - -=== Types - -[cols=1] -|=== -| Name - -| <> -| <> -| <> -|=== - - - -[#A-01-B-08-C] -== <><float>::<><double, double>::C - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐3.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -struct C; ----- - - - - -[#A-01-B-08-D-0ae] -== <><float>::<><double, double>::D - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐3.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -template<typename V> -struct D; ----- - - - - -[#A-01-B-08-D-0af] -== <><float>::<><double, double>::D<bool, bool> - - -=== Synopsis - - -Declared in `<class‐template‐specializations‐3.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -template<> -struct <><bool, bool>; ----- - - - - [#A-07] == A<unsigned int> diff --git a/test-files/golden-tests/metadata/class-template-specializations-3.html b/test-files/golden-tests/metadata/class-template-specializations-3.html index 0ec1912cfe..b4eb8f69c6 100644 --- a/test-files/golden-tests/metadata/class-template-specializations-3.html +++ b/test-files/golden-tests/metadata/class-template-specializations-3.html @@ -19,9 +19,9 @@

Types

A +A<float> A<long> A<short> -A<float> A<unsigned int> E @@ -230,7 +230,7 @@

Synopsis

-

A<long>

+

A<float>

Synopsis

@@ -239,7 +239,7 @@

Synopsis

 
 template<>
-struct A<long>;
+struct A<float>;
 
 
@@ -252,9 +252,8 @@

Types

-B -B<double> -B<float> +B +B<double, double> @@ -262,7 +261,7 @@

Types

-

A<long>::B

+

A<float>::B

Synopsis

@@ -275,6 +274,24 @@

Synopsis

+ + +
+
+
+

A<float>::B<double, double>

+
+
+

Synopsis

+
+Declared in <class-template-specializations-3.cpp>
+
+
+template<>
+struct B<double, double>;
+
+
+

Types

@@ -284,9 +301,9 @@

Types

- - - + + +
C
D
D<bool>
C
D
D<bool, bool>
@@ -294,7 +311,7 @@

Types

-

A<long>::B::C

+

A<float>::B<double, double>::C

Synopsis

@@ -311,7 +328,7 @@

Synopsis

-

A<long>::B::D

+

A<float>::B<double, double>::D

Synopsis

@@ -329,7 +346,7 @@

Synopsis

-

A<long>::B::D<bool>

+

A<float>::B<double, double>::D<bool, bool>

Synopsis

@@ -338,7 +355,7 @@

Synopsis

 
 template<>
-struct D<bool>;
+struct D<bool, bool>;
 
 
@@ -347,7 +364,7 @@

Synopsis

-

A<long>::B<double>

+

A<long>

Synopsis

@@ -356,7 +373,7 @@

Synopsis

 
 template<>
-struct B<double>;
+struct A<long>;
 
 
@@ -369,9 +386,9 @@

Types

-C -D -D<bool> +B +B<double> +B<float> @@ -379,7 +396,39 @@

Types

-

A<long>::B<double>::C

+

A<long>::B

+
+
+

Synopsis

+
+Declared in <class-template-specializations-3.cpp>
+
+
+template<typename U>
+struct B;
+
+
+
+

Types

+ + + + + + + + + + + + +
Name
C
D
D<bool>
+ + +
+
+
+

A<long>::B::C

Synopsis

@@ -396,7 +445,7 @@

Synopsis

-

A<long>::B<double>::D

+

A<long>::B::D

Synopsis

@@ -414,7 +463,7 @@

Synopsis

-

A<long>::B<double>::D<bool>

+

A<long>::B::D<bool>

Synopsis

@@ -423,7 +472,7 @@

Synopsis

 
 template<>
-struct D<bool>;
+struct D<bool>;
 
 
@@ -432,7 +481,7 @@

Synopsis

-

A<long>::B<float>

+

A<long>::B<double>

Synopsis

@@ -441,7 +490,7 @@

Synopsis

 
 template<>
-struct B<float>;
+struct B<double>;
 
 
@@ -454,9 +503,9 @@

Types

-C -D -D<bool> +C +D +D<bool> @@ -464,7 +513,7 @@

Types

-

A<long>::B<float>::C

+

A<long>::B<double>::C

Synopsis

@@ -481,7 +530,7 @@

Synopsis

-

A<long>::B<float>::D

+

A<long>::B<double>::D

Synopsis

@@ -499,25 +548,7 @@

Synopsis

-

A<long>::B<float>::D<bool>

-
-
-

Synopsis

-
-Declared in <class-template-specializations-3.cpp>
-
-
-template<>
-struct D<bool>;
-
-
-
- - -
-
-
-

A<short>

+

A<long>::B<double>::D<bool>

Synopsis

@@ -526,39 +557,7 @@

Synopsis

 
 template<>
-struct A<short>;
-
-
-
-

Types

- - - - - - - - - - - - -
Name
B
B<double>
B<void>
- - -
-
-
-

A<short>::B

-
-
-

Synopsis

-
-Declared in <class-template-specializations-3.cpp>
-
-
-template<typename U>
-struct B;
+struct D<bool>;
 
 
@@ -567,7 +566,7 @@

Synopsis

-

A<short>::B<double>

+

A<long>::B<float>

Synopsis

@@ -576,7 +575,7 @@

Synopsis

 
 template<>
-struct B<double>;
+struct B<float>;
 
 
@@ -589,9 +588,9 @@

Types

-C -D -D<bool> +C +D +D<bool> @@ -599,7 +598,7 @@

Types

-

A<short>::B<double>::C

+

A<long>::B<float>::C

Synopsis

@@ -616,7 +615,7 @@

Synopsis

-

A<short>::B<double>::D

+

A<long>::B<float>::D

Synopsis

@@ -634,7 +633,7 @@

Synopsis

-

A<short>::B<double>::D<bool>

+

A<long>::B<float>::D<bool>

Synopsis

@@ -643,7 +642,7 @@

Synopsis

 
 template<>
-struct D<bool>;
+struct D<bool>;
 
 
@@ -652,7 +651,7 @@

Synopsis

-

A<short>::B<void>

+

A<short>

Synopsis

@@ -661,7 +660,7 @@

Synopsis

 
 template<>
-struct B<void>;
+struct A<short>;
 
 
@@ -674,9 +673,9 @@

Types

-C -D -D<bool> +B +B<double> +B<void> @@ -684,7 +683,7 @@

Types

-

A<short>::B<void>::C

+

A<short>::B

Synopsis

@@ -692,7 +691,8 @@

Synopsis

Declared in <class-template-specializations-3.cpp>
 
-struct C;
+template<typename U>
+struct B;
 
 
@@ -701,7 +701,7 @@

Synopsis

-

A<short>::B<void>::D

+

A<short>::B<double>

Synopsis

@@ -709,17 +709,31 @@

Synopsis

Declared in <class-template-specializations-3.cpp>
 
-template<typename V>
-struct D;
+template<>
+struct B<double>;
 
 
+

Types

+ + + + + + + + + + + + +
Name
C
D
D<bool>
-

A<short>::B<void>::D<bool>

+

A<short>::B<double>::C

Synopsis

@@ -727,8 +741,7 @@

Synopsis

Declared in <class-template-specializations-3.cpp>
 
-template<>
-struct D<bool>;
+struct C;
 
 
@@ -737,7 +750,7 @@

Synopsis

-

A<float>

+

A<short>::B<double>::D

Synopsis

@@ -745,30 +758,17 @@

Synopsis

Declared in <class-template-specializations-3.cpp>
 
-template<>
-struct A<float>;
+template<typename V>
+struct D;
 
 
-

Types

- - - - - - - - - - - -
Name
B
B<double, double>
-

A<float>::B

+

A<short>::B<double>::D<bool>

Synopsis

@@ -776,8 +776,8 @@

Synopsis

Declared in <class-template-specializations-3.cpp>
 
-template<typename U>
-struct B;
+template<>
+struct D<bool>;
 
 
@@ -786,7 +786,7 @@

Synopsis

-

A<float>::B<double, double>

+

A<short>::B<void>

Synopsis

@@ -795,7 +795,7 @@

Synopsis

 
 template<>
-struct B<double, double>;
+struct B<void>;
 
 
@@ -808,9 +808,9 @@

Types

-C -D -D<bool, bool> +C +D +D<bool> @@ -818,7 +818,7 @@

Types

-

A<float>::B<double, double>::C

+

A<short>::B<void>::C

Synopsis

@@ -835,7 +835,7 @@

Synopsis

-

A<float>::B<double, double>::D

+

A<short>::B<void>::D

Synopsis

@@ -853,7 +853,7 @@

Synopsis

-

A<float>::B<double, double>::D<bool, bool>

+

A<short>::B<void>::D<bool>

Synopsis

@@ -862,7 +862,7 @@

Synopsis

 
 template<>
-struct D<bool, bool>;
+struct D<bool>;
 
 
diff --git a/test-files/golden-tests/metadata/class-template-specializations-3.xml b/test-files/golden-tests/metadata/class-template-specializations-3.xml index f44b4f77b2..25c26b8de7 100644 --- a/test-files/golden-tests/metadata/class-template-specializations-3.xml +++ b/test-files/golden-tests/metadata/class-template-specializations-3.xml @@ -50,6 +50,41 @@ + - - - - - - - - - diff --git a/test-files/golden-tests/metadata/dependency-propagation.adoc b/test-files/golden-tests/metadata/dependency-propagation.adoc index 1c05aebbdd..711e4d3a23 100644 --- a/test-files/golden-tests/metadata/dependency-propagation.adoc +++ b/test-files/golden-tests/metadata/dependency-propagation.adoc @@ -33,13 +33,13 @@ | Name | <> +| <> | <> | <> -| <> |=== -[#N-A] -== <>::A +[#N-B] +== <>::B === Synopsis @@ -50,14 +50,11 @@ Declared in `<dependency‐propagation.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> -struct A; +using B = <><T>; ---- - - - -[#N-D] -== <>::D +[#N-C] +== <>::C === Synopsis @@ -67,14 +64,12 @@ Declared in `<dependency‐propagation.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -struct D; +template<typename T> +using C = <><T>; ---- - - - -[#N-B] -== <>::B +[#N-A] +== <>::A === Synopsis @@ -85,11 +80,14 @@ Declared in `<dependency‐propagation.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> -using B = <><T>; +struct A; ---- -[#N-C] -== <>::C + + + +[#N-D] +== <>::D === Synopsis @@ -99,10 +97,12 @@ Declared in `<dependency‐propagation.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -template<typename T> -using C = <><T>; +struct D; ---- + + + [#E] == E diff --git a/test-files/golden-tests/metadata/dependency-propagation.html b/test-files/golden-tests/metadata/dependency-propagation.html index 09ae012d1f..081ba63b98 100644 --- a/test-files/golden-tests/metadata/dependency-propagation.html +++ b/test-files/golden-tests/metadata/dependency-propagation.html @@ -48,15 +48,15 @@

Types

A +D B -C -D +C
-

N::A

+

N::B

Synopsis

@@ -65,16 +65,14 @@

Synopsis

 
 template<typename T>
-struct A;
+using B = A<T>;
 
 
- -
-

N::D

+

N::C

Synopsis

@@ -82,16 +80,15 @@

Synopsis

Declared in <dependency-propagation.cpp>
 
-struct D;
+template<typename T>
+using C = B<T>;
 
 
- -
-

N::B

+

N::A

Synopsis

@@ -100,14 +97,16 @@

Synopsis

 
 template<typename T>
-using B = A<T>;
+struct A;
 
 
+ +
-

N::C

+

N::D

Synopsis

@@ -115,11 +114,12 @@

Synopsis

Declared in <dependency-propagation.cpp>
 
-template<typename T>
-using C = B<T>;
+struct D;
 
 
+ +
diff --git a/test-files/golden-tests/metadata/dependency-propagation.xml b/test-files/golden-tests/metadata/dependency-propagation.xml index 24997319fc..ca16f54db2 100644 --- a/test-files/golden-tests/metadata/dependency-propagation.xml +++ b/test-files/golden-tests/metadata/dependency-propagation.xml @@ -3,15 +3,6 @@ xsi:noNamespaceSchemaLocation="https://github.com/cppalliance/mrdocs/raw/develop/mrdocs.rnc"> - - - - + + + + diff --git a/test-files/golden-tests/metadata/explicit-deduct-guide.adoc b/test-files/golden-tests/metadata/explicit-deduct-guide.adoc index 70e63601e6..151005c0bb 100644 --- a/test-files/golden-tests/metadata/explicit-deduct-guide.adoc +++ b/test-files/golden-tests/metadata/explicit-deduct-guide.adoc @@ -43,7 +43,7 @@ struct X; -[#X-06] +[#X-0d] == <><0> @@ -54,11 +54,10 @@ Declared in `<explicit‐deduct‐guide.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -template<bool B = true> -<><0>(long) -> <><0>; +<><0>(bool) -> <><0>; ---- -[#X-0d] +[#X-00] == <><0> @@ -69,10 +68,10 @@ Declared in `<explicit‐deduct‐guide.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -<><0>(bool) -> <><0>; +<><0>(char) -> <><0>; ---- -[#X-00] +[#X-0b] == <><0> @@ -83,10 +82,10 @@ Declared in `<explicit‐deduct‐guide.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -<><0>(char) -> <><0>; +<><0>(int) -> <><0>; ---- -[#X-0b] +[#X-06] == <><0> @@ -97,7 +96,8 @@ Declared in `<explicit‐deduct‐guide.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -<><0>(int) -> <><0>; +template<bool B = true> +<><0>(long) -> <><0>; ---- diff --git a/test-files/golden-tests/metadata/explicit-deduct-guide.html b/test-files/golden-tests/metadata/explicit-deduct-guide.html index 976359c66d..704463abd5 100644 --- a/test-files/golden-tests/metadata/explicit-deduct-guide.html +++ b/test-files/golden-tests/metadata/explicit-deduct-guide.html @@ -57,7 +57,7 @@

Synopsis

-

X<0>

+

X<0>

Synopsis

@@ -65,15 +65,14 @@

Synopsis

Declared in <explicit-deduct-guide.cpp>
 
-template<bool B = true>
-X<0>(long) -> X<0>;
+X<0>(bool) -> X<0>;
 
 
-

X<0>

+

X<0>

Synopsis

@@ -81,14 +80,14 @@

Synopsis

Declared in <explicit-deduct-guide.cpp>
 
-X<0>(bool) -> X<0>;
+X<0>(char) -> X<0>;
 
 
-

X<0>

+

X<0>

Synopsis

@@ -96,14 +95,14 @@

Synopsis

Declared in <explicit-deduct-guide.cpp>
 
-X<0>(char) -> X<0>;
+X<0>(int) -> X<0>;
 
 
-

X<0>

+

X<0>

Synopsis

@@ -111,7 +110,8 @@

Synopsis

Declared in <explicit-deduct-guide.cpp>
 
-X<0>(int) -> X<0>;
+template<bool B = true>
+X<0>(long) -> X<0>;
 
 
diff --git a/test-files/golden-tests/metadata/explicit-deduct-guide.xml b/test-files/golden-tests/metadata/explicit-deduct-guide.xml index ea30611ab6..f3a3649a3b 100644 --- a/test-files/golden-tests/metadata/explicit-deduct-guide.xml +++ b/test-files/golden-tests/metadata/explicit-deduct-guide.xml @@ -8,18 +8,6 @@ - @@ -47,5 +35,17 @@ + diff --git a/test-files/golden-tests/metadata/function-parm-decay.adoc b/test-files/golden-tests/metadata/function-parm-decay.adoc index 483e3b93b8..d3e679e1b8 100644 --- a/test-files/golden-tests/metadata/function-parm-decay.adoc +++ b/test-files/golden-tests/metadata/function-parm-decay.adoc @@ -26,8 +26,8 @@ | <> |=== -[#f] -== f +[#T] +== T === Synopsis @@ -37,12 +37,11 @@ Declared in `<function‐parm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -void -f(int const x); +using T = int; ---- -[#g] -== g +[#U] +== U === Synopsis @@ -52,12 +51,11 @@ Declared in `<function‐parm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -void -g(int* x); +using U = int const; ---- -[#h] -== h +[#f] +== f === Synopsis @@ -68,11 +66,11 @@ Declared in `<function‐parm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -h(int x(bool)); +f(int const x); ---- -[#i] -== i +[#g] +== g === Synopsis @@ -83,11 +81,11 @@ Declared in `<function‐parm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -i(<>); +g(int* x); ---- -[#T] -== T +[#h] +== h === Synopsis @@ -97,11 +95,12 @@ Declared in `<function‐parm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -using T = int; +void +h(int x(bool)); ---- -[#U] -== U +[#i] +== i === Synopsis @@ -111,7 +110,8 @@ Declared in `<function‐parm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -using U = int const; +void +i(<>); ---- diff --git a/test-files/golden-tests/metadata/function-parm-decay.html b/test-files/golden-tests/metadata/function-parm-decay.html index e7f418d848..8da372a26b 100644 --- a/test-files/golden-tests/metadata/function-parm-decay.html +++ b/test-files/golden-tests/metadata/function-parm-decay.html @@ -40,7 +40,7 @@

Functions

-

f

+

T

Synopsis

@@ -48,15 +48,14 @@

Synopsis

Declared in <function-parm-decay.cpp>
 
-void
-f(int const x);
+using T = int;
 
 
-

g

+

U

Synopsis

@@ -64,15 +63,14 @@

Synopsis

Declared in <function-parm-decay.cpp>
 
-void
-g(int* x);
+using U = int const;
 
 
-

h

+

f

Synopsis

@@ -81,14 +79,14 @@

Synopsis

 
 void
-h(int x(bool));
+f(int const x);
 
 
-

i

+

g

Synopsis

@@ -97,14 +95,14 @@

Synopsis

 
 void
-i(T);
+g(int* x);
 
 
-

T

+

h

Synopsis

@@ -112,14 +110,15 @@

Synopsis

Declared in <function-parm-decay.cpp>
 
-using T = int;
+void
+h(int x(bool));
 
 
-

U

+

i

Synopsis

@@ -127,7 +126,8 @@

Synopsis

Declared in <function-parm-decay.cpp>
 
-using U = int const;
+void
+i(T);
 
 
diff --git a/test-files/golden-tests/metadata/function-parm-decay.xml b/test-files/golden-tests/metadata/function-parm-decay.xml index 1acdf0a59a..cf67b720fc 100644 --- a/test-files/golden-tests/metadata/function-parm-decay.xml +++ b/test-files/golden-tests/metadata/function-parm-decay.xml @@ -2,6 +2,14 @@ + + + + + + + + @@ -43,13 +51,5 @@ - - - - - - - - diff --git a/test-files/golden-tests/metadata/function-tparm-decay.adoc b/test-files/golden-tests/metadata/function-tparm-decay.adoc index 04ce851f95..2b7c0b507b 100644 --- a/test-files/golden-tests/metadata/function-tparm-decay.adoc +++ b/test-files/golden-tests/metadata/function-tparm-decay.adoc @@ -26,8 +26,8 @@ | <> |=== -[#f] -== f +[#T] +== T === Synopsis @@ -37,13 +37,11 @@ Declared in `<function‐tparm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -template<int x> -void -f(); +using T = int; ---- -[#g] -== g +[#U] +== U === Synopsis @@ -53,13 +51,11 @@ Declared in `<function‐tparm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -template<int x[4]> -void -g(); +using U = int const; ---- -[#h] -== h +[#f] +== f === Synopsis @@ -69,13 +65,13 @@ Declared in `<function‐tparm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -template<int(* x)(bool const)> +template<int x> void -h(); +f(); ---- -[#i] -== i +[#g] +== g === Synopsis @@ -85,13 +81,13 @@ Declared in `<function‐tparm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -template<int> +template<int x[4]> void -i(); +g(); ---- -[#T] -== T +[#h] +== h === Synopsis @@ -101,11 +97,13 @@ Declared in `<function‐tparm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -using T = int; +template<int(* x)(bool const)> +void +h(); ---- -[#U] -== U +[#i] +== i === Synopsis @@ -115,7 +113,9 @@ Declared in `<function‐tparm‐decay.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -using U = int const; +template<int> +void +i(); ---- diff --git a/test-files/golden-tests/metadata/function-tparm-decay.html b/test-files/golden-tests/metadata/function-tparm-decay.html index ef2f4fb7fb..182e7535cc 100644 --- a/test-files/golden-tests/metadata/function-tparm-decay.html +++ b/test-files/golden-tests/metadata/function-tparm-decay.html @@ -40,7 +40,7 @@

Functions

-

f

+

T

Synopsis

@@ -48,16 +48,14 @@

Synopsis

Declared in <function-tparm-decay.cpp>
 
-template<int x>
-void
-f();
+using T = int;
 
 
-

g

+

U

Synopsis

@@ -65,16 +63,14 @@

Synopsis

Declared in <function-tparm-decay.cpp>
 
-template<int x[4]>
-void
-g();
+using U = int const;
 
 
-

h

+

f

Synopsis

@@ -82,16 +78,16 @@

Synopsis

Declared in <function-tparm-decay.cpp>
 
-template<int(* x)(bool const)>
+template<int x>
 void
-h();
+f();
 
 
-

i

+

g

Synopsis

@@ -99,16 +95,16 @@

Synopsis

Declared in <function-tparm-decay.cpp>
 
-template<int>
+template<int x[4]>
 void
-i();
+g();
 
 
-

T

+

h

Synopsis

@@ -116,14 +112,16 @@

Synopsis

Declared in <function-tparm-decay.cpp>
 
-using T = int;
+template<int(* x)(bool const)>
+void
+h();
 
 
-

U

+

i

Synopsis

@@ -131,7 +129,9 @@

Synopsis

Declared in <function-tparm-decay.cpp>
 
-using U = int const;
+template<int>
+void
+i();
 
 
diff --git a/test-files/golden-tests/metadata/function-tparm-decay.xml b/test-files/golden-tests/metadata/function-tparm-decay.xml index b90222fb3a..2d5bf6103e 100644 --- a/test-files/golden-tests/metadata/function-tparm-decay.xml +++ b/test-files/golden-tests/metadata/function-tparm-decay.xml @@ -2,6 +2,14 @@ + + + + + + + + - - - - - - - - diff --git a/test-files/golden-tests/metadata/implicit-instantiation-member-ref.adoc b/test-files/golden-tests/metadata/implicit-instantiation-member-ref.adoc index 163a0b701e..5ff79a999c 100644 --- a/test-files/golden-tests/metadata/implicit-instantiation-member-ref.adoc +++ b/test-files/golden-tests/metadata/implicit-instantiation-member-ref.adoc @@ -11,12 +11,40 @@ |=== | Name -| <> -| <> | <> | <> +| <> +| <> |=== +[#A5] +== A5 + + +=== Synopsis + + +Declared in `<implicit‐instantiation‐member‐ref.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +using A5 = <><void>; +---- + +[#A9] +== A9 + + +=== Synopsis + + +Declared in `<implicit‐instantiation‐member‐ref.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +using A9 = <>::<><char>::<><int>::<><unsigned int>::<>; +---- + [#S0-03] == S0 @@ -200,34 +228,6 @@ template<typename V> using M3 = <><char>; ---- -[#A5] -== A5 - - -=== Synopsis - - -Declared in `<implicit‐instantiation‐member‐ref.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -using A5 = <><void>; ----- - -[#A9] -== A9 - - -=== Synopsis - - -Declared in `<implicit‐instantiation‐member‐ref.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -using A9 = <>::<><char>::<><int>::<><unsigned int>::<>; ----- - [.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/metadata/implicit-instantiation-member-ref.html b/test-files/golden-tests/metadata/implicit-instantiation-member-ref.html index dcc4544113..9791e5451d 100644 --- a/test-files/golden-tests/metadata/implicit-instantiation-member-ref.html +++ b/test-files/golden-tests/metadata/implicit-instantiation-member-ref.html @@ -18,15 +18,45 @@

Types

-A5 -A9 S0 -S0<void> +S0<void> +A5 +A9
+

A5

+
+
+

Synopsis

+
+Declared in <implicit-instantiation-member-ref.cpp>
+
+
+using A5 = S0<void>;
+
+
+
+
+
+
+

A9

+
+
+

Synopsis

+
+Declared in <implicit-instantiation-member-ref.cpp>
+
+
+using A9 = A5::S2<char>::M3<int>::M3<unsigned int>::M2;
+
+
+
+
+
+

S0

@@ -228,36 +258,6 @@

Synopsis

-
-
-

A5

-
-
-

Synopsis

-
-Declared in <implicit-instantiation-member-ref.cpp>
-
-
-using A5 = S0<void>;
-
-
-
-
-
-
-

A9

-
-
-

Synopsis

-
-Declared in <implicit-instantiation-member-ref.cpp>
-
-
-using A9 = A5::S2<char>::M3<int>::M3<unsigned int>::M2;
-
-
-
-
diff --git a/test-files/golden-tests/metadata/implicit-instantiation-member-ref.xml b/test-files/golden-tests/metadata/implicit-instantiation-member-ref.xml index 1a6de4cb61..c7c8f5852f 100644 --- a/test-files/golden-tests/metadata/implicit-instantiation-member-ref.xml +++ b/test-files/golden-tests/metadata/implicit-instantiation-member-ref.xml @@ -2,6 +2,14 @@ + + + + + + + + - - - - - - - - diff --git a/test-files/golden-tests/metadata/mem-fn.adoc b/test-files/golden-tests/metadata/mem-fn.adoc index 2037b3be67..62e4441b0e 100644 --- a/test-files/golden-tests/metadata/mem-fn.adoc +++ b/test-files/golden-tests/metadata/mem-fn.adoc @@ -728,8 +728,8 @@ void f1(...) const volatile noexcept; ---- -[#U-f2] -== <>::f2 +[#U-f3] +== <>::f3 === Synopsis @@ -739,14 +739,13 @@ Declared in `<mem‐fn.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -static -char -f2() noexcept; +virtual +int +f3() const volatile noexcept = 0; ---- -[#U-f3] -== <>::f3 +[#U-f2] +== <>::f2 === Synopsis @@ -756,9 +755,10 @@ Declared in `<mem‐fn.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -virtual -int -f3() const volatile noexcept = 0; +constexpr +static +char +f2() noexcept; ---- [#V] diff --git a/test-files/golden-tests/metadata/mem-fn.html b/test-files/golden-tests/metadata/mem-fn.html index b2bf6e0e57..c68cabbe77 100644 --- a/test-files/golden-tests/metadata/mem-fn.html +++ b/test-files/golden-tests/metadata/mem-fn.html @@ -827,7 +827,7 @@

Synopsis

-

U::f2

+

U::f3

Synopsis

@@ -835,17 +835,16 @@

Synopsis

Declared in <mem-fn.cpp>
 
-constexpr
-static
-char
-f2() noexcept;
+virtual
+int
+f3() const volatile noexcept = 0;
 
 
-

U::f3

+

U::f2

Synopsis

@@ -853,9 +852,10 @@

Synopsis

Declared in <mem-fn.cpp>
 
-virtual
-int
-f3() const volatile noexcept = 0;
+constexpr
+static
+char
+f2() noexcept;
 
 
diff --git a/test-files/golden-tests/metadata/mem-fn.xml b/test-files/golden-tests/metadata/mem-fn.xml index fc2fec3a8f..45064bb1d6 100644 --- a/test-files/golden-tests/metadata/mem-fn.xml +++ b/test-files/golden-tests/metadata/mem-fn.xml @@ -128,15 +128,6 @@ - - - - - - - - - @@ -147,6 +138,15 @@ + + + + + + + + + @@ -161,15 +161,6 @@ - - - - - - - - - @@ -179,6 +170,15 @@ + + + + + + + + + diff --git a/test-files/golden-tests/metadata/noreturn.adoc b/test-files/golden-tests/metadata/noreturn.adoc index a6f698601d..5defcb4ea7 100644 --- a/test-files/golden-tests/metadata/noreturn.adoc +++ b/test-files/golden-tests/metadata/noreturn.adoc @@ -63,8 +63,8 @@ struct T; -[#T-f2] -== <>::f2 +[#T-f3] +== <>::f3 === Synopsis @@ -75,13 +75,12 @@ Declared in `<noreturn.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[noreturn]] -static void -f2(); +f3(); ---- -[#T-f3] -== <>::f3 +[#T-f2] +== <>::f2 === Synopsis @@ -92,8 +91,9 @@ Declared in `<noreturn.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[noreturn]] +static void -f3(); +f2(); ---- [#T-08friend] diff --git a/test-files/golden-tests/metadata/noreturn.html b/test-files/golden-tests/metadata/noreturn.html index 5f121220ca..8c8a0f4a1a 100644 --- a/test-files/golden-tests/metadata/noreturn.html +++ b/test-files/golden-tests/metadata/noreturn.html @@ -89,7 +89,7 @@

Friends

-

T::f2

+

T::f3

Synopsis

@@ -98,16 +98,15 @@

Synopsis

 
 [[noreturn]]
-static
 void
-f2();
+f3();
 
 
-

T::f3

+

T::f2

Synopsis

@@ -116,8 +115,9 @@

Synopsis

 
 [[noreturn]]
+static
 void
-f3();
+f2();
 
 
diff --git a/test-files/golden-tests/metadata/noreturn.xml b/test-files/golden-tests/metadata/noreturn.xml index 7fac2b921d..cd7b613bbe 100644 --- a/test-files/golden-tests/metadata/noreturn.xml +++ b/test-files/golden-tests/metadata/noreturn.xml @@ -4,15 +4,15 @@ + + + + - - - - diff --git a/test-files/golden-tests/metadata/overloads.xml b/test-files/golden-tests/metadata/overloads.xml index 482602afda..1cba3fa7ee 100644 --- a/test-files/golden-tests/metadata/overloads.xml +++ b/test-files/golden-tests/metadata/overloads.xml @@ -56,7 +56,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -95,7 +95,7 @@ - + diff --git a/test-files/golden-tests/metadata/record-1.adoc b/test-files/golden-tests/metadata/record-1.adoc index a26cf46b70..a9ebef7784 100644 --- a/test-files/golden-tests/metadata/record-1.adoc +++ b/test-files/golden-tests/metadata/record-1.adoc @@ -66,6 +66,34 @@ struct T; |=== +[#T-U1] +== <>::U1 + + +=== Synopsis + + +Declared in `<record‐1.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +using U1 = int; +---- + +[#T-U2] +== <>::U2 + + +=== Synopsis + + +Declared in `<record‐1.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +typedef char U2; +---- + [#T-f1] == <>::f1 @@ -195,34 +223,6 @@ the separator |=== -[#T-U1] -== <>::U1 - - -=== Synopsis - - -Declared in `<record‐1.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -using U1 = int; ----- - -[#T-U2] -== <>::U2 - - -=== Synopsis - - -Declared in `<record‐1.cpp>` - -[source,cpp,subs="verbatim,replacements,macros,-callouts"] ----- -typedef char U2; ----- - [.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/metadata/record-1.html b/test-files/golden-tests/metadata/record-1.html index e641bfab26..8ff7690edd 100644 --- a/test-files/golden-tests/metadata/record-1.html +++ b/test-files/golden-tests/metadata/record-1.html @@ -85,6 +85,36 @@

Protected Member Functions

+
+
+
+

T::U1

+
+
+

Synopsis

+
+Declared in <record-1.cpp>
+
+
+using U1 = int;
+
+
+
+
+
+
+

T::U2

+
+
+

Synopsis

+
+Declared in <record-1.cpp>
+
+
+typedef char U2;
+
+
+
@@ -231,36 +261,6 @@

Parameters

-
-
-

T::U1

-
-
-

Synopsis

-
-Declared in <record-1.cpp>
-
-
-using U1 = int;
-
-
-
-
-
-
-

T::U2

-
-
-

Synopsis

-
-Declared in <record-1.cpp>
-
-
-typedef char U2;
-
-
-
-
diff --git a/test-files/golden-tests/metadata/record-1.xml b/test-files/golden-tests/metadata/record-1.xml index 3d102c4a18..634e480dca 100644 --- a/test-files/golden-tests/metadata/record-1.xml +++ b/test-files/golden-tests/metadata/record-1.xml @@ -4,6 +4,14 @@ + + + + + + + + @@ -64,14 +72,6 @@ - - - - - - - - diff --git a/test-files/golden-tests/metadata/record-access.adoc b/test-files/golden-tests/metadata/record-access.adoc index 6a9e5200a6..0d1d8e3cb8 100644 --- a/test-files/golden-tests/metadata/record-access.adoc +++ b/test-files/golden-tests/metadata/record-access.adoc @@ -57,8 +57,8 @@ class C0; | <> |=== -[#C0-f0] -== <>::f0 +[#C0-f2] +== <>::f2 === Synopsis @@ -69,7 +69,7 @@ Declared in `<record‐access.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -f0(); +f2(); ---- [#C0-f1] @@ -87,8 +87,8 @@ void f1(); ---- -[#C0-f2] -== <>::f2 +[#C0-f0] +== <>::f0 === Synopsis @@ -99,7 +99,7 @@ Declared in `<record‐access.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void -f2(); +f0(); ---- [#S0] diff --git a/test-files/golden-tests/metadata/record-access.html b/test-files/golden-tests/metadata/record-access.html index 9b823bd0cf..1118014038 100644 --- a/test-files/golden-tests/metadata/record-access.html +++ b/test-files/golden-tests/metadata/record-access.html @@ -79,7 +79,7 @@

Private Member Functions

-

C0::f0

+

C0::f2

Synopsis

@@ -88,7 +88,7 @@

Synopsis

 
 void
-f0();
+f2();
 
 
@@ -111,7 +111,7 @@

Synopsis

-

C0::f2

+

C0::f0

Synopsis

@@ -120,7 +120,7 @@

Synopsis

 
 void
-f2();
+f0();
 
 
diff --git a/test-files/golden-tests/metadata/record-access.xml b/test-files/golden-tests/metadata/record-access.xml index b860971304..28453021a5 100644 --- a/test-files/golden-tests/metadata/record-access.xml +++ b/test-files/golden-tests/metadata/record-access.xml @@ -4,14 +4,14 @@ - - + + - - + + diff --git a/test-files/golden-tests/metadata/record-data.adoc b/test-files/golden-tests/metadata/record-data.adoc index 35dabe89d8..a7828a595d 100644 --- a/test-files/golden-tests/metadata/record-data.adoc +++ b/test-files/golden-tests/metadata/record-data.adoc @@ -191,8 +191,8 @@ class V; | <> |=== -[#V-i] -== <>::i +[#V-j] +== <>::j === Synopsis @@ -202,11 +202,11 @@ Declared in `<record‐data.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -int i; +unsigned long j; ---- -[#V-j] -== <>::j +[#V-i] +== <>::i === Synopsis @@ -216,7 +216,7 @@ Declared in `<record‐data.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -unsigned long j; +int i; ---- [#V-k] diff --git a/test-files/golden-tests/metadata/record-data.html b/test-files/golden-tests/metadata/record-data.html index a6b52c041f..4de3560a47 100644 --- a/test-files/golden-tests/metadata/record-data.html +++ b/test-files/golden-tests/metadata/record-data.html @@ -223,7 +223,7 @@

Private Data Members

-

V::i

+

V::j

Synopsis

@@ -231,14 +231,14 @@

Synopsis

Declared in <record-data.cpp>
 
-int i;
+unsigned long j;
 
 
-

V::j

+

V::i

Synopsis

@@ -246,7 +246,7 @@

Synopsis

Declared in <record-data.cpp>
 
-unsigned long j;
+int i;
 
 
diff --git a/test-files/golden-tests/metadata/record-data.xml b/test-files/golden-tests/metadata/record-data.xml index a06c65a31c..4c9c5d512d 100644 --- a/test-files/golden-tests/metadata/record-data.xml +++ b/test-files/golden-tests/metadata/record-data.xml @@ -35,14 +35,14 @@ - - - - + + + + diff --git a/test-files/golden-tests/metadata/requires-clause.adoc b/test-files/golden-tests/metadata/requires-clause.adoc index 1a56dc6256..ee9509bf34 100644 --- a/test-files/golden-tests/metadata/requires-clause.adoc +++ b/test-files/golden-tests/metadata/requires-clause.adoc @@ -91,22 +91,22 @@ Declared in `<requires‐clause.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> -requires (sizeof(T) == 4) +requires (sizeof(T) == 2) void -<>(); +<>(); ---- -[.small]#<># +[.small]#<># [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> -requires (sizeof(T) == 2) +requires (sizeof(T) == 4) void -<>(); +<>(); ---- -[.small]#<># +[.small]#<># [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- @@ -118,7 +118,7 @@ void [.small]#<># -[#g-00] +[#g-04] == g @@ -130,12 +130,12 @@ Declared in `<requires‐clause.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> -requires (sizeof(T) == 4) +requires (sizeof(T) == 2) void g(); ---- -[#g-04] +[#g-00] == g @@ -147,7 +147,7 @@ Declared in `<requires‐clause.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> -requires (sizeof(T) == 2) +requires (sizeof(T) == 4) void g(); ---- diff --git a/test-files/golden-tests/metadata/requires-clause.html b/test-files/golden-tests/metadata/requires-clause.html index 2ead9f0d1e..76736c5648 100644 --- a/test-files/golden-tests/metadata/requires-clause.html +++ b/test-files/golden-tests/metadata/requires-clause.html @@ -103,20 +103,20 @@

Synopsis

 
 template<typename T>
-requires (sizeof(T) == 4)
+requires (sizeof(T) == 2)
 void
-g();
+g();
 
-
» more... +» more...
 
 template<typename T>
-requires (sizeof(T) == 2)
+requires (sizeof(T) == 4)
 void
-g();
+g();
 
-
» more... +» more...
 
@@ -132,7 +132,7 @@ 

Synopsis

-

g

+

g

Synopsis

@@ -141,7 +141,7 @@

Synopsis

 
 template<typename T>
-requires (sizeof(T) == 4)
+requires (sizeof(T) == 2)
 void
 g();
 
@@ -150,7 +150,7 @@ 

Synopsis

-

g

+

g

Synopsis

@@ -159,7 +159,7 @@

Synopsis

 
 template<typename T>
-requires (sizeof(T) == 2)
+requires (sizeof(T) == 4)
 void
 g();
 
diff --git a/test-files/golden-tests/metadata/requires-clause.xml b/test-files/golden-tests/metadata/requires-clause.xml
index 6fa2abab77..0ce46e5c7e 100644
--- a/test-files/golden-tests/metadata/requires-clause.xml
+++ b/test-files/golden-tests/metadata/requires-clause.xml
@@ -22,18 +22,18 @@
       
     
   
-  
   
+  
   
+  
   
-  
   
     
     
-