mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 21:25:13 +00:00
Adding pragma warning(disable: 4522) for MSVC <= 2017. (#3142)
This commit is contained in:
parent
b193d42c32
commit
85b38c69de
@ -19,7 +19,6 @@
|
|||||||
# pragma warning(disable: 4100) // warning C4100: Unreferenced formal parameter
|
# pragma warning(disable: 4100) // warning C4100: Unreferenced formal parameter
|
||||||
# pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
|
# pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
|
||||||
# pragma warning(disable: 4800) // warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
|
# pragma warning(disable: 4800) // warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
|
||||||
# pragma warning(disable: 4522) // warning C4522: multiple assignment operators specified
|
|
||||||
# pragma warning(disable: 4505) // warning C4505: 'PySlice_GetIndicesEx': unreferenced local function has been removed (PyPy only)
|
# pragma warning(disable: 4505) // warning C4505: 'PySlice_GetIndicesEx': unreferenced local function has been removed (PyPy only)
|
||||||
#elif defined(__GNUG__) && !defined(__clang__)
|
#elif defined(__GNUG__) && !defined(__clang__)
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
|
@ -532,6 +532,10 @@ object object_or_cast(T &&o);
|
|||||||
// Match a PyObject*, which we want to convert directly to handle via its converting constructor
|
// Match a PyObject*, which we want to convert directly to handle via its converting constructor
|
||||||
inline handle object_or_cast(PyObject *ptr) { return ptr; }
|
inline handle object_or_cast(PyObject *ptr) { return ptr; }
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && _MSC_VER < 1920
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable: 4522) // warning C4522: multiple assignment operators specified
|
||||||
|
#endif
|
||||||
template <typename Policy>
|
template <typename Policy>
|
||||||
class accessor : public object_api<accessor<Policy>> {
|
class accessor : public object_api<accessor<Policy>> {
|
||||||
using key_type = typename Policy::key_type;
|
using key_type = typename Policy::key_type;
|
||||||
@ -580,6 +584,9 @@ private:
|
|||||||
key_type key;
|
key_type key;
|
||||||
mutable object cache;
|
mutable object cache;
|
||||||
};
|
};
|
||||||
|
#if defined(_MSC_VER) && _MSC_VER < 1920
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
PYBIND11_NAMESPACE_BEGIN(accessor_policies)
|
PYBIND11_NAMESPACE_BEGIN(accessor_policies)
|
||||||
struct obj_attr {
|
struct obj_attr {
|
||||||
|
Loading…
Reference in New Issue
Block a user