pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.18k stars 2.06k forks source link

chore: help Coverty avoid generating a false positive. #4817

Closed rwgk closed 10 months ago

rwgk commented 11 months ago

Description

Please see #4814 for background.

This PR does not change the pybind11 behavior at all when NDEBUG is set.

For Coverty use -UNDEBUG.

The variable name change was helpful in determining that we think of the Coverty result as a false positive. The name change could be reverted, but is useful to keep (increases readability).

Suggested changelog entry:

An ``assert()`` was added to help Coverty avoid generating a false positive.
henryiii commented 10 months ago

Does current_overload cause some sort of wrapping? Why remove the last three chars?

rwgk commented 10 months ago

Does current_overload cause some sort of wrapping? Why remove the last three chars?

Changed to current_overload.

The longer name is great, I don't have a strong preference one way or another.

rwgk commented 10 months ago

Thanks Henry!