Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/mrdocs/Metadata/Symbol/SymbolBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ struct MRDOCS_VISIBLE Symbol {
*/
ExtractionMode Extraction = ExtractionMode::Dependency;

/** Whether this a copy of an inherited method, as produced when
`inherit-base-members` is not `never`.
*/
bool IsCopyFromInherited = false;

/** The parent symbol, if any.

This is the parent namespace or record
Expand Down
1 change: 1 addition & 0 deletions src/lib/Metadata/Finalizers/BaseMembersFinalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ inheritBaseMembers(
otherCopy->id = SymbolID::createFromString(
std::format("{}-{}", toBase16Str(otherCopy->Parent),
toBase16Str(otherInfo.id)));
otherCopy->IsCopyFromInherited = true;
derived.push_back(otherCopy->id);
// Get the extraction mode from the derived class
if (otherCopy->Extraction == ExtractionMode::Dependency ||
Expand Down
7 changes: 6 additions & 1 deletion src/lib/Metadata/Finalizers/DocCommentFinalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,8 @@ DocCommentFinalizer::warnUndocumented()
if (Symbol const* I = corpus_.find(undocI.id))
{
MRDOCS_CHECK_OR(
!I->doc || I->Extraction == ExtractionMode::Regular);
!I->doc || I->Extraction == ExtractionMode::Regular
|| I->IsCopyFromInherited == false);
}
bool const prefer_definition = is_one_of(
undocI.kind, {SymbolKind::Record, SymbolKind::Enum});
Expand All @@ -1752,6 +1753,7 @@ warnDocErrors()
for (auto const& I : corpus_.info_)
{
MRDOCS_CHECK_OR_CONTINUE(I->Extraction == ExtractionMode::Regular);
MRDOCS_CHECK_OR_CONTINUE(I->IsCopyFromInherited == false);
MRDOCS_CHECK_OR_CONTINUE(I->isFunction());
warnParamErrors(dynamic_cast<FunctionSymbol const&>(*I));
}
Expand Down Expand Up @@ -1807,6 +1809,7 @@ warnNoParamDocs()
for (auto const& I : corpus_.info_)
{
MRDOCS_CHECK_OR_CONTINUE(I->Extraction == ExtractionMode::Regular);
MRDOCS_CHECK_OR_CONTINUE(I->IsCopyFromInherited == false);
MRDOCS_CHECK_OR_CONTINUE(I->isFunction());
MRDOCS_CHECK_OR_CONTINUE(I->doc);
warnNoParamDocs(dynamic_cast<FunctionSymbol const&>(*I));
Expand Down Expand Up @@ -1869,6 +1872,7 @@ warnUndocEnumValues()
{
MRDOCS_CHECK_OR_CONTINUE(I->isEnumConstant());
MRDOCS_CHECK_OR_CONTINUE(I->Extraction == ExtractionMode::Regular);
MRDOCS_CHECK_OR_CONTINUE(I->IsCopyFromInherited == false);
MRDOCS_CHECK_OR_CONTINUE(!I->doc);
this->warn(
*getPrimaryLocation(*I),
Expand All @@ -1886,6 +1890,7 @@ warnUnnamedParams()
{
MRDOCS_CHECK_OR_CONTINUE(I->isFunction());
MRDOCS_CHECK_OR_CONTINUE(I->Extraction == ExtractionMode::Regular);
MRDOCS_CHECK_OR_CONTINUE(I->IsCopyFromInherited == false);
MRDOCS_CHECK_OR_CONTINUE(I->doc);
warnUnnamedParams(dynamic_cast<FunctionSymbol const&>(*I));
}
Expand Down
8 changes: 8 additions & 0 deletions test-files/golden-tests/regression/1119.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
= Reference
:mrdocs:

[#index]
== Global namespace


[.small]#Created with https://www.mrdocs.com[MrDocs]#
13 changes: 13 additions & 0 deletions test-files/golden-tests/regression/1119.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace ns {
struct Foo {
/// bar
int
bar();
};
} // namespace ns

/// project namespace
namespace mrdocs {
/// Baz
struct Baz : ns::Foo {};
} // namespace mrdocs
19 changes: 19 additions & 0 deletions test-files/golden-tests/regression/1119.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<html lang="en">
<head>
<title>Reference</title>
</head>
<body>
<div>
<h1>Reference</h1>
<div>
<div>
<h2 id="index"></h2>
</div>
</div>

</div>
<div>
<h4>Created with <a href="https://www.mrdocs.com">MrDocs</a></h4>
</div>
</body>
</html>
6 changes: 6 additions & 0 deletions test-files/golden-tests/regression/1119.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<mrdocs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://github.com/cppalliance/mrdocs/raw/develop/mrdocs.rnc">
<namespace id="//////////////////////////8=">
</namespace>
</mrdocs>
2 changes: 2 additions & 0 deletions test-files/golden-tests/regression/1119.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include-symbols:
- 'foobar::**'
Loading