@@ -719,7 +719,7 @@ class cpp_function : public function {
719
719
/* Iterator over the list of potentially admissible overloads */
720
720
const function_record *overloads = reinterpret_cast <function_record *>(
721
721
PyCapsule_GetPointer (self, get_function_record_capsule_name ())),
722
- *it = overloads;
722
+ *current_overload = overloads;
723
723
assert (overloads != nullptr );
724
724
725
725
/* Need to know how many arguments + keyword arguments there are to pick the right
@@ -757,9 +757,10 @@ class cpp_function : public function {
757
757
std::vector<function_call> second_pass;
758
758
759
759
// However, if there are no overloads, we can just skip the no-convert pass entirely
760
- const bool overloaded = it != nullptr && it->next != nullptr ;
760
+ const bool overloaded
761
+ = current_overload != nullptr && current_overload->next != nullptr ;
761
762
762
- for (; it != nullptr ; it = it ->next ) {
763
+ for (; current_overload != nullptr ; current_overload = current_overload ->next ) {
763
764
764
765
/* For each overload:
765
766
1. Copy all positional arguments we were given, also checking to make sure that
@@ -780,7 +781,7 @@ class cpp_function : public function {
780
781
a result other than PYBIND11_TRY_NEXT_OVERLOAD.
781
782
*/
782
783
783
- const function_record &func = *it ;
784
+ const function_record &func = *current_overload ;
784
785
size_t num_args = func.nargs ; // Number of positional arguments that we need
785
786
if (func.has_args ) {
786
787
--num_args; // (but don't count py::args
@@ -1018,10 +1019,10 @@ class cpp_function : public function {
1018
1019
}
1019
1020
1020
1021
if (result.ptr () != PYBIND11_TRY_NEXT_OVERLOAD) {
1021
- // The error reporting logic below expects 'it ' to be valid, as it would be
1022
- // if we'd encountered this failure in the first-pass loop.
1022
+ // The error reporting logic below expects 'current_overload ' to be valid,
1023
+ // as it would be if we'd encountered this failure in the first-pass loop.
1023
1024
if (!result) {
1024
- it = &call.func ;
1025
+ current_overload = &call.func ;
1025
1026
}
1026
1027
break ;
1027
1028
}
@@ -1168,7 +1169,8 @@ class cpp_function : public function {
1168
1169
if (!result) {
1169
1170
std::string msg = " Unable to convert function return value to a "
1170
1171
" Python type! The signature was\n\t " ;
1171
- msg += it->signature ;
1172
+ assert (current_overload != nullptr );
1173
+ msg += current_overload->signature ;
1172
1174
append_note_if_missing_header_is_suspected (msg);
1173
1175
// Attach additional error info to the exception if supported
1174
1176
if (PyErr_Occurred ()) {
0 commit comments