Commit df8494dc by Andy Maloney Committed by GitHub

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
parent 14b37512
......@@ -1910,7 +1910,7 @@ template <return_value_policy Policy = return_value_policy::reference_internal,
template <typename InputType, typename OutputType> void implicitly_convertible() {
struct set_flag {
bool &flag;
set_flag(bool &flag) : flag(flag) { flag = true; }
set_flag(bool &flag_) : flag(flag_) { flag_ = true; }
~set_flag() { flag = false; }
};
auto implicit_caster = [](PyObject *obj, PyTypeObject *type) -> PyObject * {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment