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

Fix errors in template specialization with qualified arguments #1012

Merged

Conversation

yut23
Copy link
Contributor

@yut23 yut23 commented Jan 16, 2025

This addresses the problem mentioned in the TODO comment in sphinxrenderer.py, which I ran into with this piece of code: https://github.com/AMReX-Astro/Microphysics/blob/b7fa023216305edce0ea4a8cff60e6a781a69400/util/microphysics_autodiff.H#L229-L234

The change in sphinxrenderer.py fixes the class name being cut off inside the template argument, corresponding to this warning:

breathe/documentation/source/specific.rst:247: WARNING: Invalid C++ declaration: Expected end of definition. [error at 15]
  template<> Foo >
  ---------------^

The change in filter.py fixes the class being duplicated outside its namespace, corresponding to these errors and warnings:

breathe/documentation/source/specific.rst:3: CRITICAL: Duplicate ID: "cpp_ns_template_specializationstructns2_1_1_trait_3_01ns1_1_1_foo_01_4_1ae96d840cc2c8f12b13e15f5b66dbdf03".
breathe/documentation/source/specific.rst:3: WARNING: Duplicate explicit target name: "cpp_ns_template_specializationstructns2_1_1_trait_3_01ns1_1_1_foo_01_4_1ae96d840cc2c8f12b13e15f5b66dbdf03".
breathe/documentation/source/specific.rst:3: CRITICAL: Duplicate ID: "cpp_ns_template_specializationstructns2_1_1_trait_3_01ns1_1_1_foo_01_4".
breathe/documentation/source/specific.rst:3: WARNING: Duplicate explicit target name: "cpp_ns_template_specializationstructns2_1_1_trait_3_01ns1_1_1_foo_01_4".
Before and after screenshots

Before After
breathe-ns-template-spec-before breathe-ns-template-spec-after

@AA-Turner
Copy link
Collaborator

cc @Rouslan

@Rouslan
Copy link

Rouslan commented Jan 17, 2025

Hi @AA-Turner, why have you mentioned me? Did you want my input on something?

Since you brought this to my attention, I tested my own fork. The first problem identified in this pull request is already solved because I replaced the naive string split with a small hand-written parser. The second is not, and I will try to fix it later.

@AA-Turner AA-Turner merged commit 252a51b into breathe-doc:main Jan 21, 2025
27 checks passed
@yut23 yut23 deleted the template-specialization-with-namespace branch January 21, 2025 19:03
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.

3 participants