mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-26 07:02:11 +00:00
fix: a clang warning [-Wshadow-field-in-constructor-modified] (#2780)
* Fix a clang warning from [-Wshadow-field-in-constructor-modified] warning: modifying constructor parameter 'flag' that shadows a field of 'set_flag' [-Wshadow-field-in-constructor-modified] * Change name based on review
This commit is contained in:
parent
14b375123c
commit
df8494dc86
@ -1910,7 +1910,7 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
|
|||||||
template <typename InputType, typename OutputType> void implicitly_convertible() {
|
template <typename InputType, typename OutputType> void implicitly_convertible() {
|
||||||
struct set_flag {
|
struct set_flag {
|
||||||
bool &flag;
|
bool &flag;
|
||||||
set_flag(bool &flag) : flag(flag) { flag = true; }
|
set_flag(bool &flag_) : flag(flag_) { flag_ = true; }
|
||||||
~set_flag() { flag = false; }
|
~set_flag() { flag = false; }
|
||||||
};
|
};
|
||||||
auto implicit_caster = [](PyObject *obj, PyTypeObject *type) -> PyObject * {
|
auto implicit_caster = [](PyObject *obj, PyTypeObject *type) -> PyObject * {
|
||||||
|
Loading…
Reference in New Issue
Block a user