which I believe to be a false positive. I don't think cstr is dangling at the point of use. The lifetime of the initializer list gets extended for the entire range based for loop.
If I make it const auto& cstrI cease getting the error but the deduced type is const char* const either way. https://cppinsights.io/s/7682d5d4
causes
which I believe to be a false positive. I don't think cstr is dangling at the point of use. The lifetime of the initializer list gets extended for the entire range based for loop.
If I make it
const auto& cstr
I cease getting the error but the deduced type is const char* const either way.https://cppinsights.io/s/7682d5d4
This is related to https://github.com/danmar/cppcheck/commit/a57fc9ace6f288b9c887d4ac6a24444cdceccd83
See https://trac.cppcheck.net/ticket/12173
If you go through this process: https://trac.cppcheck.net/ you can get your own trac account 😉
Thank you Christian for not only adding the issue but already having fixed it!
I'll go ahead and request an trac account.