I also did some digging around and it seems that in condition in checkautovariables.cpp:588 (as for f16ffd88e96efc4ab5a538fa61197741be6fee3b) marks error because 'textToNumber' function's scope ends after 'f''s end of scope.
This issue is not visible if std::string_view is replaced with const std::string&. I am not sure how to apporach it, should std::string_view be translated into a reference or a pointer to original string?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When uplifting to cppcheck 2.9 I got report on this code:
For me it looks like FP since str is not out of range.
You can find full file in the attachment
Have a great day!
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11508
Hi again!
I am trying to investigate this issue and managed to simplify this issue further:
I also did some digging around and it seems that in condition in checkautovariables.cpp:588 (as for f16ffd88e96efc4ab5a538fa61197741be6fee3b) marks error because 'textToNumber' function's scope ends after 'f''s end of scope.
This issue is not visible if std::string_view is replaced with const std::string&. I am not sure how to apporach it, should std::string_view be translated into a reference or a pointer to original string?