Skip to content

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