From 27e15666363a35973e6cb2c41ced4e9fe2d40945 Mon Sep 17 00:00:00 2001 From: alandefreitas Date: Sun, 2 Feb 2025 14:53:12 -0300 Subject: [PATCH] `sort-members` option #feat --- docs/mrdocs.schema.json | 60 + include/mrdocs/ADT/Polymorphic.hpp | 35 + include/mrdocs/Corpus.hpp | 23 +- include/mrdocs/Dom/LazyArray.hpp | 4 +- include/mrdocs/Dom/LazyObject.hpp | 4 +- include/mrdocs/Metadata/Info.hpp | 12 +- include/mrdocs/Metadata/Info/Concept.hpp | 4 + include/mrdocs/Metadata/Info/Function.hpp | 3 + include/mrdocs/Metadata/Info/Guide.hpp | 4 + include/mrdocs/Metadata/Info/Namespace.hpp | 4 + include/mrdocs/Metadata/Info/Record.hpp | 6 +- include/mrdocs/Metadata/Info/Typedef.hpp | 6 + include/mrdocs/Metadata/Info/Variable.hpp | 4 + include/mrdocs/Metadata/Javadoc.hpp | 323 +- include/mrdocs/Metadata/Name.hpp | 7 +- include/mrdocs/Metadata/Source.hpp | 2 + include/mrdocs/Metadata/Specifiers.hpp | 11 +- include/mrdocs/Metadata/Template.hpp | 88 +- include/mrdocs/Metadata/Type.hpp | 57 +- include/mrdocs/Platform.hpp | 8 + .../common/partials/symbol/members-table.hbs | 4 +- src/lib/AST/ASTAction.cpp | 2 +- src/lib/AST/ParseJavadoc.cpp | 26 +- src/lib/AST/TypeInfoBuilder.cpp | 6 +- src/lib/Gen/hbs/MultiPageVisitor.cpp | 3 +- src/lib/Gen/hbs/SinglePageVisitor.cpp | 4 +- src/lib/Gen/xml/XMLWriter.cpp | 52 +- src/lib/Lib/ConfigOptions.json | 42 + src/lib/Metadata/Finalize.cpp | 12 + .../Finalizers/BaseMembersFinalizer.hpp | 2 +- .../Finalizers/OverloadsFinalizer.hpp | 2 +- .../Finalizers/ReferenceFinalizer.cpp | 4 +- .../Finalizers/SortMembersFinalizer.cpp | 297 ++ .../Finalizers/SortMembersFinalizer.hpp | 74 + src/lib/Metadata/Info.cpp | 47 - src/lib/Metadata/Info/Concept.cpp | 43 + src/lib/Metadata/Info/Function.cpp | 62 +- src/lib/Metadata/Info/Guide.cpp | 54 + src/lib/Metadata/Info/Record.cpp | 42 + src/lib/Metadata/Info/Typedef.cpp | 43 + src/lib/Metadata/Info/Variable.cpp | 43 + src/lib/Metadata/Javadoc.cpp | 34 +- src/lib/Metadata/Name.cpp | 24 +- src/lib/Metadata/Template.cpp | 56 + src/lib/Metadata/Type.cpp | 78 +- src/lib/Support/Handlebars.cpp | 4 +- src/lib/Support/Radix.cpp | 6 +- src/lib/Support/Radix.hpp | 8 +- .../copy-dependencies.adoc | 22 +- .../copy-dependencies.html | 16 +- .../copy-dependencies.xml | 98 +- .../config/inherit-base-members/copy.adoc | 128 +- .../config/inherit-base-members/copy.html | 118 +- .../config/inherit-base-members/copy.xml | 98 +- .../config/inherit-base-members/reference.xml | 74 +- .../config/sort/sort-members.adoc | 647 +++ .../golden-tests/config/sort/sort-members.cpp | 60 + .../config/sort/sort-members.html | 683 +++ .../golden-tests/config/sort/sort-members.xml | 265 ++ .../golden-tests/config/sort/sort-members.yml | 1 + .../golden-tests/config/sort/unordered.adoc | 647 +++ .../golden-tests/config/sort/unordered.cpp | 60 + .../golden-tests/config/sort/unordered.html | 683 +++ .../golden-tests/config/sort/unordered.xml | 265 ++ .../golden-tests/config/sort/unordered.yml | 6 + .../filters/symbol-name/extraction-mode.adoc | 110 +- .../filters/symbol-name/extraction-mode.html | 132 +- .../filters/symbol-name/extraction-mode.xml | 60 +- .../golden-tests/javadoc/brief/brief-3.adoc | 42 +- .../golden-tests/javadoc/brief/brief-3.html | 40 +- .../golden-tests/javadoc/brief/brief-3.xml | 22 +- test-files/golden-tests/javadoc/ref/ref.adoc | 162 +- test-files/golden-tests/javadoc/ref/ref.html | 128 +- test-files/golden-tests/javadoc/ref/ref.xml | 136 +- .../golden-tests/metadata/alias-template.adoc | 32 +- .../golden-tests/metadata/alias-template.html | 36 +- .../golden-tests/metadata/alias-template.xml | 14 +- .../metadata/class-template-partial-spec.adoc | 18 +- .../metadata/class-template-partial-spec.html | 16 +- .../metadata/class-template-partial-spec.xml | 14 +- .../metadata/class-template-spec.adoc | 30 +- .../metadata/class-template-spec.html | 22 +- .../metadata/class-template-spec.xml | 20 +- .../class-template-specializations-1.adoc | 3712 +++++++-------- .../class-template-specializations-1.html | 4074 ++++++++--------- .../class-template-specializations-1.xml | 690 +-- .../class-template-specializations-2.adoc | 216 +- .../class-template-specializations-2.html | 212 +- .../class-template-specializations-2.xml | 58 +- .../class-template-specializations-3.adoc | 254 +- .../class-template-specializations-3.html | 264 +- .../class-template-specializations-3.xml | 70 +- .../metadata/decay-to-primary.adoc | 60 +- .../metadata/decay-to-primary.html | 66 +- .../metadata/decay-to-primary.xml | 16 +- .../metadata/dependency-propagation.adoc | 40 +- .../metadata/dependency-propagation.html | 30 +- .../metadata/dependency-propagation.xml | 18 +- .../metadata/explicit-deduct-guide.adoc | 18 +- .../metadata/explicit-deduct-guide.html | 18 +- .../metadata/explicit-deduct-guide.xml | 24 +- .../metadata/function-parm-decay.adoc | 40 +- .../metadata/function-parm-decay.html | 28 +- .../metadata/function-parm-decay.xml | 16 +- .../metadata/function-tparm-decay.adoc | 48 +- .../metadata/function-tparm-decay.html | 36 +- .../metadata/function-tparm-decay.xml | 16 +- .../implicit-instantiation-member-ref.adoc | 60 +- .../implicit-instantiation-member-ref.html | 66 +- .../implicit-instantiation-member-ref.xml | 16 +- test-files/golden-tests/metadata/mem-fn.adoc | 22 +- test-files/golden-tests/metadata/mem-fn.html | 18 +- test-files/golden-tests/metadata/mem-fn.xml | 36 +- .../golden-tests/metadata/noreturn.adoc | 14 +- .../golden-tests/metadata/noreturn.html | 10 +- test-files/golden-tests/metadata/noreturn.xml | 8 +- .../golden-tests/metadata/overloads.xml | 8 +- .../golden-tests/metadata/record-1.adoc | 56 +- .../golden-tests/metadata/record-1.html | 60 +- test-files/golden-tests/metadata/record-1.xml | 16 +- .../golden-tests/metadata/record-access.adoc | 12 +- .../golden-tests/metadata/record-access.html | 8 +- .../golden-tests/metadata/record-access.xml | 8 +- .../golden-tests/metadata/record-data.adoc | 12 +- .../golden-tests/metadata/record-data.html | 8 +- .../golden-tests/metadata/record-data.xml | 8 +- .../metadata/requires-clause.adoc | 20 +- .../metadata/requires-clause.html | 20 +- .../golden-tests/metadata/requires-clause.xml | 12 +- .../spec-mem-implicit-instantiation.adoc | 234 +- .../spec-mem-implicit-instantiation.html | 212 +- .../spec-mem-implicit-instantiation.xml | 82 +- .../metadata/static-data-template.adoc | 18 +- .../metadata/static-data-template.html | 16 +- .../metadata/static-data-template.xml | 22 +- .../template-specialization-inheritance.adoc | 128 +- .../template-specialization-inheritance.html | 140 +- .../template-specialization-inheritance.xml | 48 +- .../metadata/type-resolution.adoc | 86 +- .../metadata/type-resolution.html | 92 +- .../golden-tests/metadata/type-resolution.xml | 30 +- test-files/golden-tests/metadata/using-3.adoc | 20 +- test-files/golden-tests/metadata/using-3.html | 16 +- test-files/golden-tests/metadata/using-3.xml | 12 +- .../metadata/variadic-function.adoc | 46 +- .../metadata/variadic-function.html | 34 +- .../metadata/variadic-function.xml | 26 +- 147 files changed, 11366 insertions(+), 7062 deletions(-) create mode 100644 src/lib/Metadata/Finalizers/SortMembersFinalizer.cpp create mode 100644 src/lib/Metadata/Finalizers/SortMembersFinalizer.hpp create mode 100644 test-files/golden-tests/config/sort/sort-members.adoc create mode 100644 test-files/golden-tests/config/sort/sort-members.cpp create mode 100644 test-files/golden-tests/config/sort/sort-members.html create mode 100644 test-files/golden-tests/config/sort/sort-members.xml create mode 100644 test-files/golden-tests/config/sort/sort-members.yml create mode 100644 test-files/golden-tests/config/sort/unordered.adoc create mode 100644 test-files/golden-tests/config/sort/unordered.cpp create mode 100644 test-files/golden-tests/config/sort/unordered.html create mode 100644 test-files/golden-tests/config/sort/unordered.xml create mode 100644 test-files/golden-tests/config/sort/unordered.yml diff --git a/docs/mrdocs.schema.json b/docs/mrdocs.schema.json index cfe978481..8424e59b8 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/Polymorphic.hpp b/include/mrdocs/ADT/Polymorphic.hpp index 10314fd0c..b73ab0db0 100644 --- a/include/mrdocs/ADT/Polymorphic.hpp +++ b/include/mrdocs/ADT/Polymorphic.hpp @@ -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/Corpus.hpp b/include/mrdocs/Corpus.hpp index 2dbbd6bc0..68c4a187a 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,7 +233,7 @@ class MRDOCS_VISIBLE } } } - else + else /* ordered */ { auto members0 = allMembers(I); static_assert(range_of); @@ -245,11 +245,16 @@ class MRDOCS_VISIBLE { 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 e26701760..a7119a13b 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 2da3ebfdd..1de9c7d11 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 69b09de30..2df866da8 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 42e7627bb..1073b7316 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/Function.hpp b/include/mrdocs/Metadata/Info/Function.hpp index 043f220ad..80cbed5f1 100644 --- a/include/mrdocs/Metadata/Info/Function.hpp +++ b/include/mrdocs/Metadata/Info/Function.hpp @@ -175,6 +175,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 069b0b32b..dd60e3134 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 { @@ -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 8c5790b3e..6affbb062 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/Record.hpp b/include/mrdocs/Metadata/Info/Record.hpp index bcff275b8..efaf8e193 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 { @@ -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/Typedef.hpp b/include/mrdocs/Metadata/Info/Typedef.hpp index 4b41bd0ff..4d47d5a64 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 { @@ -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/Variable.hpp b/include/mrdocs/Metadata/Info/Variable.hpp index 8ff92e2fa..c8d8ece54 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 { @@ -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 86b5f925a..628b60517 100644 --- a/include/mrdocs/Metadata/Javadoc.hpp +++ b/include/mrdocs/Metadata/Javadoc.hpp @@ -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); } }; @@ -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); } @@ -419,7 +442,7 @@ struct MRDOCS_DECL protected: explicit Block( - Kind kind_, + NodeKind const kind_, std::vector> children_ = {}) noexcept : Node(kind_) , children(std::move(children_)) @@ -432,23 +455,24 @@ struct MRDOCS_DECL /** 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,24 +481,25 @@ 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, + 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(); @@ -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; /* @} */ diff --git a/include/mrdocs/Metadata/Name.hpp b/include/mrdocs/Metadata/Name.hpp index 15b6d6e76..d7fe9181f 100644 --- a/include/mrdocs/Metadata/Name.hpp +++ b/include/mrdocs/Metadata/Name.hpp @@ -152,12 +152,9 @@ visit( } } -inline +MRDOCS_DECL std::strong_ordering -operator<=>(Polymorphic const& lhs, Polymorphic const& rhs) -{ - return CompareDerived(lhs, rhs); -} +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs); inline bool diff --git a/include/mrdocs/Metadata/Source.hpp b/include/mrdocs/Metadata/Source.hpp index 74d05df05..795965677 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 bf884b880..4a0551ef5 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 d15e25d15..0d557065d 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<=>(Polymorphic const& lhs, Polymorphic const& rhs); - enum class TArgKind : int { // type arguments @@ -151,18 +149,9 @@ visit( } } -inline +MRDOCS_DECL std::strong_ordering -operator<=>(Polymorphic const& lhs, Polymorphic const& rhs) -{ - return CompareDerived(lhs, rhs); -} - -inline -bool -operator==(Polymorphic const& lhs, Polymorphic const& rhs) { - return lhs <=> rhs == std::strong_ordering::equal; -} +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs); MRDOCS_DECL std::string @@ -308,7 +297,7 @@ struct TypeTParam final /** The type-constraint for the parameter, if any. */ Polymorphic Constraint; - auto operator<=>(TypeTParam const&) const = default; + std::strong_ordering operator<=>(TypeTParam const&) const; }; struct NonTypeTParam final @@ -326,23 +315,8 @@ struct TemplateTParam final /** Template parameters for the template-template parameter */ 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,12 +350,9 @@ visit( } } -inline +MRDOCS_DECL std::strong_ordering -operator<=>(Polymorphic const& lhs, Polymorphic const& rhs) -{ - return CompareDerived(lhs, rhs); -} +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs); inline bool @@ -435,9 +406,48 @@ struct TemplateInfo return TemplateSpecKind::Partial; } - auto operator<=>(TemplateInfo const&) const = default; + auto 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); + } }; +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 361d6db95..ecd1d92ac 100644 --- a/include/mrdocs/Metadata/Type.hpp +++ b/include/mrdocs/Metadata/Type.hpp @@ -245,7 +245,8 @@ struct AutoTypeInfo final AutoKind Keyword = AutoKind::Auto; Polymorphic Constraint; - auto operator<=>(AutoTypeInfo const&) const = default; + std::strong_ordering + operator<=>(AutoTypeInfo const&) const; }; struct LValueReferenceTypeInfo final @@ -259,7 +260,8 @@ struct LValueReferenceTypeInfo final return PointeeType.operator->(); } - auto operator<=>(LValueReferenceTypeInfo const&) const = default; + std::strong_ordering + operator<=>(LValueReferenceTypeInfo const&) const; }; struct RValueReferenceTypeInfo final @@ -273,7 +275,8 @@ struct RValueReferenceTypeInfo final return PointeeType.operator->(); } - auto operator<=>(RValueReferenceTypeInfo const&) const = default; + std::strong_ordering + operator<=>(RValueReferenceTypeInfo const&) const; }; struct PointerTypeInfo final @@ -288,7 +291,8 @@ struct PointerTypeInfo final return PointeeType.operator->(); } - auto operator<=>(PointerTypeInfo const&) const = default; + std::strong_ordering + operator<=>(PointerTypeInfo const&) const; }; struct MemberPointerTypeInfo final @@ -304,7 +308,9 @@ struct MemberPointerTypeInfo final return PointeeType.operator->(); } - auto operator<=>(MemberPointerTypeInfo const&) const = default; + + std::strong_ordering + operator<=>(MemberPointerTypeInfo const&) const; }; struct ArrayTypeInfo final @@ -319,7 +325,8 @@ struct ArrayTypeInfo final return ElementType.operator->(); } - auto operator<=>(ArrayTypeInfo const&) const = default; + std::strong_ordering + operator<=>(ArrayTypeInfo const&) const; }; struct FunctionTypeInfo final @@ -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,12 +403,9 @@ visit( } } -inline +MRDOCS_DECL std::strong_ordering -operator<=>(Polymorphic const& lhs, Polymorphic const& rhs) -{ - return CompareDerived(lhs, rhs); -} +operator<=>(Polymorphic const& lhs, Polymorphic const& rhs); inline bool diff --git a/include/mrdocs/Platform.hpp b/include/mrdocs/Platform.hpp index ea07c8af9..4c7f77e29 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/share/mrdocs/addons/generator/common/partials/symbol/members-table.hbs b/share/mrdocs/addons/generator/common/partials/symbol/members-table.hbs index 86e5d41d7..2845944e2 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 485251f66..76e884ffe 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/ParseJavadoc.cpp b/src/lib/AST/ParseJavadoc.cpp index 708537197..aec0c5104 100644 --- a/src/lib/AST/ParseJavadoc.cpp +++ b/src/lib/AST/ParseJavadoc.cpp @@ -405,12 +405,12 @@ 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; } @@ -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()); @@ -494,7 +494,7 @@ parseStyled(StringRef s) } 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) { @@ -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,12 +652,12 @@ 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 @@ -1569,7 +1569,7 @@ visitParamCommandComment( jd_.getBlocks(), [&](Polymorphic const& b) { - if (b->kind != doc::Kind::param) + if (b->Kind != doc::NodeKind::param) { return false; } @@ -1612,7 +1612,7 @@ visitTParamCommandComment( jd_.getBlocks(), [&](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 98934c951..d02aa27c6 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); diff --git a/src/lib/Gen/hbs/MultiPageVisitor.cpp b/src/lib/Gen/hbs/MultiPageVisitor.cpp index 6681b4183..88985a101 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 534230189..66d89a4c5 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/xml/XMLWriter.cpp b/src/lib/Gen/xml/XMLWriter.cpp index b2df4aa29..c78d290b4 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/Lib/ConfigOptions.json b/src/lib/Lib/ConfigOptions.json index 3fb9943ca..62bfd2f1d 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 814e7f41f..9c9a9a008 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 a3aa35d13..53090fda4 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 3bfa1bb07..1690fdc4b 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 8b07d5d85..7be748e6b 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/SortMembersFinalizer.cpp b/src/lib/Metadata/Finalizers/SortMembersFinalizer.cpp new file mode 100644 index 000000000..972369b5a --- /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 + +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) +{ + // Stable sort ensures equivalent elements are presented in + // the same order as they were in the source code. + std::stable_sort(ids.begin(), ids.end(), SymbolIDCompareFn{info_, config_}); +} + +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 000000000..9a15133eb --- /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 ad57ddb03..db2746b0f 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 3a50182ba..66b6144c2 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 d36dac5b5..7d30e316c 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 4a38d563c..9ec5712d9 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 1b73ba849..d9c67c471 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 34229c3bd..dacd2f3c9 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 9aac20b31..51b674830 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 e49102256..2f57f4f88 100644 --- a/src/lib/Metadata/Javadoc.cpp +++ b/src/lib/Metadata/Javadoc.cpp @@ -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; } @@ -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; @@ -273,15 +273,15 @@ emplace_back( 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) diff --git a/src/lib/Metadata/Name.cpp b/src/lib/Metadata/Name.cpp index 17e3bad45..86b40aafd 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 7e0d271e0..b4b3c435c 100644 --- a/src/lib/Metadata/Template.cpp +++ b/src/lib/Metadata/Template.cpp @@ -66,6 +66,22 @@ toString( } } +inline +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 +99,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 +180,31 @@ tag_invoke( v = dom::LazyObject(I, domCorpus); } +std::strong_ordering +TypeTParam:: +operator<=>(TypeTParam 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( diff --git a/src/lib/Metadata/Type.cpp b/src/lib/Metadata/Type.cpp index 35d404620..5534d816f 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 660abdb5d..adc69a6dc 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 679bd29d3..d98b04283 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 8e44b6d8c..a8347e3fc 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/test-files/golden-tests/config/inherit-base-members/copy-dependencies.adoc b/test-files/golden-tests/config/inherit-base-members/copy-dependencies.adoc index 5f9890d17..387315950 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 a670b703e..7020bc924 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 98861e510..1bf9b4da3 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 079cf487a..70bb2bb3e 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 2b06963d8..771614b9b 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 c61cc8258..f617ea27d 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 a9fc508f8..96d55bcb6 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 000000000..71fab1f01 --- /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 000000000..c65f3cf8d --- /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 000000000..4b187eaef --- /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 000000000..a525afc9c --- /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 000000000..8cc1c56b3 --- /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 000000000..553765412 --- /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 000000000..c65f3cf8d --- /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 000000000..6c0120d59 --- /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 000000000..9326d67b1 --- /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 000000000..8bd19f7a6 --- /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 36b45d810..5dea0914e 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 9b922a263..cd16d64e9 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 2300ed720..2a0f94699 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 889956615..eca2988c9 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 9f3b73e75..e3ed536e5 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 3e384f84b..045c163f1 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 5d2b28487..cdf5b5769 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 180f6b855..0482c7bd1 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 35132d96c..cd030bc12 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 eb31304aa..642019768 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 c2c7384c4..19d2785d2 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 fa94e7a18..0a502a6a4 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 601e90415..b2c8d067e 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 669e55771..3c5786a93 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 3dca89c28..5faa2e2b7 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 b724b382a..748add1f4 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 22782bc39..d1be7000c 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 30438ee9a..4517512a1 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 face17dd1..fb2d793bc 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 a4baeb645..29ee0f02a 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 096c1a89e..68dc4c199 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 d06ae09df..2a5ec3053 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 0ec1912cf..b4eb8f69c 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 f44b4f77b..25c26b8de 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 1c05aebbd..711e4d3a2 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 09ae012d1..081ba63b9 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 24997319f..ca16f54db 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 70e63601e..151005c0b 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 976359c66..704463abd 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 ea30611ab..f3a3649a3 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 483e3b93b..d3e679e1b 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 e7f418d84..8da372a26 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 1acdf0a59..cf67b720f 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 04ce851f9..2b7c0b507 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 ef2f4fb7f..182e7535c 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 b90222fb3..2d5bf6103 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 163a0b701..5ff79a999 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 dcc454411..9791e5451 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 1a6de4cb6..c7c8f5852 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 2037b3be6..62e4441b0 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 b2bf6e0e5..c68cabbe7 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 fc2fec3a8..45064bb1d 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 a6f698601..5defcb4ea 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 5f121220c..8c8a0f4a1 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 7fac2b921..cd7b613bb 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 482602afd..1cba3fa7e 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 a26cf46b7..a9ebef778 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 e641bfab2..8ff7690ed 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 3d102c4a1..634e480dc 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 6a9e5200a..0d1d8e3cb 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 9b823bd0c..111801403 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 b86097130..28453021a 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 35dabe89d..a7828a595 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 a6b52c041..4de3560a4 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 a06c65a31..4c9c5d512 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 1a56dc625..ee9509bf3 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 2ead9f0d1..76736c564 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 6fa2abab7..0ce46e5c7 100644
--- a/test-files/golden-tests/metadata/requires-clause.xml
+++ b/test-files/golden-tests/metadata/requires-clause.xml
@@ -22,18 +22,18 @@
       
     
   
-  
   
+  
   
+  
   
-  
   
     
     
-