Updgrading to cppcheck 2.11 I know get CastIntegerToAddressAtReturn warnings on the following test code reduced from my codebase:
int* nested_template_lambda_return() { auto explicitTemplate = []<typename T>() { return true; }; auto noTemplate = []() { return true; }; return nullptr; }
$ cppcheck test.cpp --enable=portability Checking test.cpp ... test.cpp:5:5: portability: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn] return true; ^
This only happens with explicit template specification on lambdas. cppcheck 2.10 was fine with that code so far.
Thanks for reporting, please see https://trac.cppcheck.net/ticket/11275
Log in to post a comment.
Updgrading to cppcheck 2.11 I know get CastIntegerToAddressAtReturn warnings on the following test code reduced from my codebase:
This only happens with explicit template specification on lambdas. cppcheck 2.10 was fine with that code so far.
Thanks for reporting, please see https://trac.cppcheck.net/ticket/11275