py::register_exception clang15.0.7 Win32 #4574
MarianoGamo
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using official clang 15.0.7 as a custom compiler inside VS2022, I can compile the following snippet in 64 bits configurations with no problem:
However when I compile for 32 bits I am getting the following error:
`1>------ Build started: Project: test_no_trivially_copyable, Configuration: Release Win32 ------
1>In file included from not_working.cpp:1:
1>C:\PROJECTS\fx\externalLibs\master\pybind11\2_10_3\include\pybind11/pybind11.h(2569,41): error : cannot compile this forwarded non-trivially copyable parameter yet
1>Done building project "test_no_trivially_copyable.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 3:32 PM and took 02.935 seconds ==========
`
That snippet can be compiled and seems to work with VS2022 compiler both in 32 and 64, gcc-11(64 Ubuntu22 WSL), gcc-12(64 Ubuntu22 WSL), clang-15.0.7 (64 Ubuntu22 WSL) . 32 bits WSL cross-compilation not tried.
I have found a workaround by defining a classic template function instead of the lambda just before:
template <typename CppException> exception<CppException> & register_exception_impl(handle scope, const char *name, handle base, bool isLocal)
I do not think the issue is related with the VS2002 Integration, but with clang/pybind/32 bits, aniway in case is needed I can supply a small isolated VS2022 solution, that only required clang15.0.3 installed in Windows. As a summary, basically the VS2022 integration is made by putting in a .props file:
C:\software\LLVM-15.0.7 15.0.7 ` Including this file in the .vcxproj file like:`
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="test_no_trivially_copyable.props" /> </ImportGroup>
And selecting LLVM (clang-cl) as Patform toolset.
Any idea what I could be doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions