Skip to content

fix: remove static from type_has_shared_from_this - #6155

Closed
lucascolley wants to merge 1 commit into
pybind:masterfrom
lucascolley:patch-1
Closed

fix: remove static from type_has_shared_from_this#6155
lucascolley wants to merge 1 commit into
pybind:masterfrom
lucascolley:patch-1

Conversation

@lucascolley

@lucascolley lucascolley commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

I hit the following warning when trying to build SciPy with clang-23 in scipy/scipy#26041:

In file included from /home/runner/work/scipy/scipy/.pixi/envs/build-clang-23/include/pybind11/trampoline_self_life_support.h:8:
In file included from /home/runner/work/scipy/scipy/.pixi/envs/build-clang-23/include/pybind11/detail/using_smart_holder.h:8:
/home/runner/work/scipy/scipy/.pixi/envs/build-clang-23/include/pybind11/detail/struct_smart_holder.h:71:13: error: unused function template 'type_has_shared_from_this' [-Werror,-Wunused-template]
   71 | static auto type_has_shared_from_this(const T *ptr)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~

Claude code says that these static qualifiers are incorrect, since including them on a function at namespace scope implies that they are only visible in this translation unit.

@rwgk

rwgk commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Thanks for reporting this issue. As currently submitted, this PR does not make the motivating Clang 23 build pass on its own: it does not include the changes from #6155, so including pybind11/pybind11.h still fails with -Werror,-Wunused-template at type_has_shared_from_this.

Could you please consolidate all changes required for the reported SciPy build into this PR, including any additional warnings encountered, and rerun the original build to confirm that it completes successfully?

Could you please also provide the exact compiler details — ideally the complete clang++ --version output, maybe also the package/channel or LLVM commit used, and the relevant build command and compiler flags? Since Clang 23 is currently a pre-release compiler, that information would make the issue reproducible and help confirm that the fix is complete. Thanks!

@lucascolley

Copy link
Copy Markdown
Contributor Author

I replied at #6156 (comment)

@rwgk

rwgk commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Closing in favor of #6156.

@rwgk rwgk closed this Aug 28, 2026
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