[BUG]: Errors in VS 2022 and c++ 20
Open
Nobody has claimed this yet.
compiler issue
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
Required prerequisites
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- Consider asking first in the Gitter chat room or in a Discussion.
Problem description
when i build with pybind11, it failed to build
i use Visual Studio 2022 and C++ 20
##Errors
Severity Code Description Project File Line Suppression State
Error C2678 binary '-': no operator found which takes a left-hand operand of type 'const L' (or there is no acceptable conversion) VTIL-Python J:\My_Projects\VTIL-Python\external\pybind11\include\pybind11\operators.h 115
Error C2672 'pybind11::class_<vtil::symbolic::directive::instance>::def': no matching overloaded function found VTIL-Python J:\My_Projects\VTIL-Python\external\pybind11\include\pybind11\operators.h 52
Error C2893 Failed to specialize function template 'pybind11::class_<vtil::symbolic::directive::instance> &pybind11::class_<vtil::symbolic::directive::instance>::def(const char *,Func &&,const Extra &...)' VTIL-Python J:\My_Projects\VTIL-Python\external\pybind11\include\pybind11\operators.h 47
Error C2678 binary '*': no operator found which takes a left-hand operand of type 'const L' (or there is no acceptable conversion) VTIL-Python J:\My_Projects\VTIL-Python\external\pybind11\include\pybind11\operators.h 117
Error C2088 '*': illegal for struct VTIL-Python J:\My_Projects\VTIL-Python\external\pybind11\include\pybind11\operators.h 117
Reproducible example code
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pybind11/include/pybind11/operators.h at lines 47, 52, 115, and 117, using the reported Visual Studio 2022 and C++20 errors as the entry point. Because no reproducible example is provided, first establish a minimal reproduction of the operator errors. Done means the failure is reproducible and its cause or required correction is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100