You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My Thing
===========
.. cpp:class:: Class
.. cpp:function:: Class(int f)
Does something with ints
.. cpp:function:: Class(double f)
Does something with doubles
.. cpp:function:: Class(string f)
Does something with strings
Note that the second declaration is not indented correctly (one space is missing).
This causes the following error:
Target: string.. [100%] floof
ParentKey: [(<ASTNestedNameElement Class>, None), (<ASTNestedNameElement Class>, None), (<ASTNestedNameElement Class>, None)]
Exception occurred:
File "/usr/lib/python3.6/site-packages/sphinx/domains/cpp.py", line 6133, in _resolve_xref_inner
assert parentSymbol # should be there
AssertionError
The full traceback has been saved in /home/jack/var/tmp/sphinx-err-851mc0mm.log, if you want to report the issue to the developers.
Traceback log is
# Sphinx version: 1.7.5
# Python version: 3.6.6 (CPython)
# Docutils version: 0.14
# Jinja2 version: 2.10
# Last messages:
# done
#
# preparing documents...
#
# done
#
# writing output... [ 50%] contents
#
# writing output... [100%] floof
#
# Loaded extensions:
# alabaster (0.7.11) from /usr/lib/python3.6/site-packages/alabaster/__init__.py
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/sphinx/cmdline.py", line 304, in main
app.build(args.force_all, filenames)
File "/usr/lib/python3.6/site-packages/sphinx/application.py", line 331, in build
self.builder.build_update()
File "/usr/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 342, in build_update
'out of date' % len(to_build))
File "/usr/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 403, in build
self.write(docnames, list(updated_docnames), method)
File "/usr/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 440, in write
self._write_serial(sorted(docnames))
File "/usr/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 447, in _write_serial
doctree = self.env.get_and_resolve_doctree(docname, self)
File "/usr/lib/python3.6/site-packages/sphinx/environment/__init__.py", line 813, in get_and_resolve_doctree
self.apply_post_transforms(doctree, docname)
File "/usr/lib/python3.6/site-packages/sphinx/environment/__init__.py", line 860, in apply_post_transforms
transformer.apply_transforms()
File "/usr/lib/python3.6/site-packages/sphinx/transforms/__init__.py", line 96, in apply_transforms
Transformer.apply_transforms(self)
File "/usr/lib/python3.6/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms
transform.apply(**kwargs)
File "/usr/lib/python3.6/site-packages/sphinx/transforms/post_transforms/__init__.py", line 90, in apply
typ, target, node, contnode)
File "/usr/lib/python3.6/site-packages/sphinx/domains/cpp.py", line 6205, in resolve_xref
target, node, contnode)[0]
File "/usr/lib/python3.6/site-packages/sphinx/domains/cpp.py", line 6133, in _resolve_xref_inner
assert parentSymbol # should be there
AssertionError
Of course indenting correctly fixes the issue, but this took some time to figure out.
There are a couple of other issues about this assertion (#2413, #2536) but they seem to be caused by an unrelated (and already fixed) issue with handling duplicate declarations.
OS: Arch Linux
Python version: 3.6.6
Sphinx version: 1.7.5
The text was updated successfully, but these errors were encountered:
Thanks for reporting! It should be fixed in the upcoming version 1.8. A warning will be issue for the last declaration (Class(string f)), that it is a nested declaration of another function, and the declaration (along with any content) will be completely ignored.
The following input causes an assertion failure:
Note that the second declaration is not indented correctly (one space is missing).
This causes the following error:
Traceback log is
Of course indenting correctly fixes the issue, but this took some time to figure out.
There are a couple of other issues about this assertion (#2413, #2536) but they seem to be caused by an unrelated (and already fixed) issue with handling duplicate declarations.
The text was updated successfully, but these errors were encountered: