Skip to content

Regression with class template specialization matching in Doxygen 1.9.1 #251

@cz4rs

Description

@cz4rs

Following assertion triggers in recent builds of DARMA-tasking/vt when using the latest version of m.css (699abdd):

assert compound.name.startswith(prefix)

Traceback with additional details:

diff --git a/documentation/doxygen.py b/documentation/doxygen.py
index d3ef69eb..ae214cc6 100755
--- a/documentation/doxygen.py
+++ b/documentation/doxygen.py
@@ -2597,7 +2597,7 @@ def postprocess_state(state: State):
             prefix = state.compounds[compound.parent].name + '::'
-            assert compound.name.startswith(prefix)
+            assert compound.name.startswith(prefix), f"compound.name: {compound.name}\nprefix: {prefix}"
             compound.leaf_name = compound.name[len(prefix):]
Traceback (most recent call last):
  File "/build/vt/./m.css/documentation/doxygen.py", line 4305, in <module>
    run(state, templates=os.path.abspath(args.templates), wildcard=args.wildcard, index_pages=args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "/build/vt/./m.css/documentation/doxygen.py", line 4128, in run
    postprocess_state(state)
  File "/build/vt/./m.css/documentation/doxygen.py", line 2600, in postprocess_state
    assert compound.name.startswith(prefix), f"compound.name: {compound.name}\nprefix: {prefix}"
AssertionError: compound.name: vt::rdma::Handle&lt;T, E, IndexT, typename std::enable_if_t&lt;not std::is_same&lt;IndexT, vt::NodeType&gt;::value&gt;&gt;::IndexTagType
prefix: vt::rdma::Handle::

Proposed fix:

diff --git a/documentation/doxygen.py b/documentation/doxygen.py
index d3ef69eb..42378197 100755
--- a/documentation/doxygen.py
+++ b/documentation/doxygen.py
@@ -2597,7 +2597,7 @@ def postprocess_state(state: State):
             prefix = state.compounds[compound.parent].name + '::'
-            assert compound.name.startswith(prefix)
+            assert compound.name.startswith(state.compounds[compound.parent].name)
             compound.leaf_name = compound.name[len(prefix):]

This seems to be enough to get our build passing, not sure if any caveats apply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    TODO

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions