sphinx-doc / sphinx-doc/sphinx
"Invalid C++ declaration" with C++ lambda expression
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When building the Apache Arrow docs, we get the following warning:
/home/antoine/arrow/dev/docs/source/cpp/api/dataset.rst:62: WARNING: Parsing of expression failed. Using fallback parser. Error was:
Error in postfix expression, expected primary expression or type.
If primary expression:
Invalid C++ declaration: Expected identifier in nested name. [error at 59]
std::function< Status(FileWriter *)> writer_pre_finish = [](FileWriter*) {returnStatus::OK();}
-----------------------------------------------------------^
If type:
Invalid C++ declaration: Expected identifier in nested name. [error at 59]
std::function< Status(FileWriter *)> writer_pre_finish = [](FileWriter*) {returnStatus::OK();}
-----------------------------------------------------------^
How to Reproduce
The build procedure is a bit too complex to reproduce here. But I don't think that matters since the context is clear from the warning message above.
Expected behavior
Ideally there's a way to silence the warning. I understand that parsing C++ is hard, so I'm not necessarily expecting Sphinx to get it right in all cases :-) But the warning is distracting.
Your project
Screenshots
No response
OS
Ubuntu 20.04
Python version
3.9.7
Sphinx version
4.3.2
Sphinx extensions
breathe 4.31.0
Extra tools
doxygen 1.9.2
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with docs/source/cpp/api/dataset.rst and the reported Sphinx C++ declaration parsing warning; reproduce it through the Apache Arrow documentation build if possible. Trace the relevant parser or configuration entry point using the stated Sphinx 4.3.2, Breathe 4.31.0, and Doxygen 1.9.2 versions, with completion marked by handling the lambda without a distracting warning or identifying a way to silence it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100