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:
Andy Maloney 2021-01-13 23:15:27 -05:00 committed by GitHub
parent 14b375123c
commit df8494dc86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 * {