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

AssertionError when using anonymous namespaces #1021

Open
IcarusCoding opened this issue Feb 11, 2025 · 0 comments
Open

AssertionError when using anonymous namespaces #1021

IcarusCoding opened this issue Feb 11, 2025 · 0 comments

Comments

@IcarusCoding
Copy link

When using anonymous namespaces like:

namespace {
constexpr std::string_view test{"test"};
}

I get the following error:

[...] WARNING: Error in type declaration.
If typedef-like declaration:
  Type must be either just a name or a typedef-like declaration.
  If just a name:
    Error in declarator or parameters-and-qualifiers
    Invalid C++ declaration: Expected identifier in nested name. [error at 0]
      
      ^
  If typedef-like declaration:
    Invalid C++ declaration: Expected identifier in nested name. [error at 0]
      
      ^
If type alias or template alias:
  Invalid C++ declaration: Expected identifier in nested name. [error at 0]
    
    ^

Exception occurred:
  File "/usr/lib/python3/dist-packages/breathe/renderer/sphinxrenderer.py", line 710, in handle_declaration
    assert isinstance(n, addnodes.desc_sig_keyword)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

The following works though:

namespace test {
namespace {
constexpr std::string_view test{"test"};
}
}

Environment:

Platform:              linux; (Linux-6.8.0-51-generic-x86_64-with-glibc2.39)
Python version:        3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0])
Python implementation: CPython
Sphinx version:        7.2.6
Docutils version:      0.20.1
Jinja2 version:        3.1.2
Pygments version:      2.17.2
Breathe version:       4.35.0
Doxygen version:       1.9.8
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

No branches or pull requests

1 participant