Repository navigation
feat(config): inherit hidden friends of base classes - #1329
alandefreitas merged 15 commits into
Conversation
…implicit-base-classes
✨ Highlights
🧾 Changes by Scope
🔝 Top Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1329 +/- ##
========================================
Coverage 83.12% 83.12%
========================================
Files 35 35
Lines 3662 3662
Branches 844 844
========================================
Hits 3044 3044
Misses 410 410
Partials 208 208
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
An automated preview of the documentation is available at https://1329.mrdocs.prtest2.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-09-29 23:04:20 UTC |
|
Follow-up on this pass filed as #1332: one generic hidden friend is copied into every derived class rather than documented once, and when two filtered bases declare friends of the same name the second is dropped from the corpus entirely. In mp-units that costs the units and the quantity specs all of their arithmetic and comparison operators. |
A class whose operators are hidden friends of a base loses them from the reference when that base is filtered out. This is the shape mp-units (see #1309) uses for every operator on its quantity type, and our own demo of that library showed no comparison operators at all. This is a common C++ idiom.
This PR adds a setting that carries a base's hidden friends onto the classes that inherit them. It mirrors the existing setting for inherited members: never, reference, copy dependencies, or copy all. A copy is placed in the derived class's namespace with its parameter types changed to the derived type, and its page says which class declared it. Every function now also records which class it is a hidden friend of (#124), so its page can explain why ordinary lookup can't find the name.
The other commits are problems this feature ran into, since this feature is very complex and sensitive to edge cases.
Fixes #1309. Fixes #124. Fixes #1326.
Changes
Testing
The golden fixtures under the new option's directory cover the feature, and the full suite passes.
Documentation
The extraction page has a new section on the setting, and the option reference and schema files are generated from the schema.