diff --git a/include/nanobind/nb_traits.h b/include/nanobind/nb_traits.h index 7e2eb0f4..4480c868 100644 --- a/include/nanobind/nb_traits.h +++ b/include/nanobind/nb_traits.h @@ -174,21 +174,21 @@ template constexpr bool is_class_caster_v = detail::detector::value; // Primary template -template +template struct is_complex : std::false_type {}; // Specialization if `T` is complex, i.e., `T` has a member type `value_type`, // member functions `real()` and `imag()` that return such, and the size of // `T` is twice that of `value_type`. template -struct is_complex().real()), - typename T::value_type> - && std::is_same_v< - decltype(std::declval().imag()), - typename T::value_type> - && (sizeof(T) == - 2 * sizeof(typename T::value_type))>> +struct is_complex().real()), + typename T::value_type> + && std::is_same_v< + decltype(std::declval().imag()), + typename T::value_type> + && (sizeof(T) == + 2 * sizeof(typename T::value_type))>> : std::true_type {}; /// True if the type `T` is a complete type representing a complex number. diff --git a/src/nb_enum.cpp b/src/nb_enum.cpp index 550f11d5..8e1ffa8c 100644 --- a/src/nb_enum.cpp +++ b/src/nb_enum.cpp @@ -172,13 +172,13 @@ bool enum_from_python(const std::type_info *tp, PyObject *o, int64_t *out, uint8 return false; if ((t->flags & (uint32_t) enum_flags::is_flag) != 0 && Py_TYPE(o) == t->type_py) { - PyObject *pValue = PyObject_GetAttrString(o, "value"); - if (pValue == nullptr) { + PyObject *value_o = PyObject_GetAttrString(o, "value"); + if (value_o == nullptr) { PyErr_Clear(); return false; } if ((t->flags & (uint32_t) enum_flags::is_signed)) { - long long value = PyLong_AsLongLong(pValue); + long long value = PyLong_AsLongLong(value_o); if (value == -1 && PyErr_Occurred()) { PyErr_Clear(); return false; @@ -186,7 +186,7 @@ bool enum_from_python(const std::type_info *tp, PyObject *o, int64_t *out, uint8 *out = (int64_t) value; return true; } else { - unsigned long long value = PyLong_AsUnsignedLongLong(pValue); + unsigned long long value = PyLong_AsUnsignedLongLong(value_o); if (value == (unsigned long long) -1 && PyErr_Occurred()) { PyErr_Clear(); return false;