Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation/doxygen: added support for C++20 concepts #232

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

marzer
Copy link
Contributor

@marzer marzer commented Oct 3, 2022

This PR adds all the plumbing necessary to have C++20's concepts appear in the doxygen documentation.

It also makes a number of other small fixes in order to have the tests behave better on Doxygen 1.9.0 (e.g. constexpr and static leaking into variable types, similar to my previous fix for functions in #228).

Overall this is a relatively substantial PR and there's still a number of boxes that need to be ticked, so I'm marking it as 'draft'.

Outstanding tasks:

  • Decide how to show the actual 'implementation' of the concepts.

    • Doxygen treats concepts as being somewhere between a variable and a type (i.e. they are a fully-fledged <compounddef> but they also get an <initializer>). Since their implementations can be pretty verbose/non-trivial (example) it probably doesn't make sense to inline them in the same way an as enum initializer, and instead display it on the detail page (i.e. extend the base-class-reference.html template). I have no idea how do that and have the syntax highlighting work, though.
  • Decide what to do about this: C++ concepts are not linked to namespaces in XML output doxygen/doxygen#9622

    • Currently Doxygen's XML output is missing the <innerconcept> elements necessary to link concepts to their containing namespace. I've worked around this as part of the XML post-process in Poxy, but haven't yet made any attempt to backport those fixes to m.css (mostly because I'm still not familiar enough with the code to make a good decision about where that should happen). I could port that back to m.css (with some effort), but it also may be sufficient to simply say "hey concepts might be broken before Doxygen 1.9.6".
  • Add tests

@marzer marzer force-pushed the add-cpp20-concepts-support branch 3 times, most recently from d1760f4 to 5ae171e Compare October 5, 2022 03:23
@codecov
Copy link

codecov bot commented Oct 5, 2022

Codecov Report

Patch coverage: 90.90% and project coverage change: -0.08 ⚠️

Comparison is base (3e0650a) 98.11% compared to head (2503273) 98.03%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #232      +/-   ##
==========================================
- Coverage   98.11%   98.03%   -0.08%     
==========================================
  Files          27       27              
  Lines        6994     7026      +32     
  Branches       49       49              
==========================================
+ Hits         6862     6888      +26     
- Misses        132      138       +6     
Impacted Files Coverage Δ
documentation/doxygen.py 98.68% <90.90%> (-0.27%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

also:
- fixed `static` and `constexpr` leaking into variables (basically the same problem as mosra#228)
- fixed a few tests that were broken with Doxygen 1.9.0+
- added support for C++20's `constinit`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant