Skip to content

demo issue occuring in pybind11-stubgen #5628

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

Closed
wants to merge 1 commit into from

Conversation

dyollb
Copy link
Contributor

@dyollb dyollb commented Apr 23, 2025

Description

Illustrates #5627

Distinct classes with the same name but in separate anonymous namespaces trigger

ImportError: generic_type: type "Foo" is already registered!

This seems to be a new behavior in the current master branch and did not happen in 2.13.6.

Suggested changelog entry:

@rwgk
Copy link
Collaborator

rwgk commented Apr 23, 2025

This is a known "feature" of clang:

See:

PR #4319

llvm/llvm-project#79367

test_unnamed_namespace_a.cpp
test_unnamed_namespace_a.py
test_unnamed_namespace_b.cpp
test_unnamed_namespace_b.py

(That's why I defensively use the long-winded namespaces in many of the test_class_sh_*.cpp files.)

@rwgk rwgk closed this Apr 23, 2025
@dyollb
Copy link
Contributor Author

dyollb commented Apr 23, 2025

Thanks for the explanation

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.

2 participants