sphinx-doc / sphinx-doc/sphinx

C++, cpp:var item rejected in in cpp:function

Open
#6,175 1 comment 0 reactions 1 assignee View on GitHub

@jakobandersen is already working on this.

Since Mar 13, 2019.

domains:cpp type:bug
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

ping @jakobandersen

I've been using cpp:var items inside cpp:function items to help document behaviours etc., and this is now being rejected. For instance:


.. cpp:function:: template<typename It> void foo(It start, It stop)

    .. cpp:var:: auto const length = std::distance(start, stop)

        The notional distance between the two iterators.

    :complexity: :math:`\Theta(length)`

This used to be accepted, with references in cpp:expr or cpp:texpr linking to the appropriate places and such. This now results in something like:

WARNING: C++ declarations inside functions are not supported. Parent function is foo()

This looks to be related to the #5191 fix.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.