cppcheck (2.8) is not able to understand that a return type declared as:
std::enable_if_t<sizeof(uint64_t_==8> is void.</sizeof(uint64_t_==8>
Example:
#include <type_traits> #include <stdint.h> std::enable_if_t<sizeof(uint64_t)==8> foo() { } int main() { foo(); }
cppcheck reports: Found a exit path from function with non-void return type that has missing return statement
note that if the return type is declared as:
std::enable_if<sizeof(uint64_t)==8>::type then cppcheck recognize the return type as void.</sizeof(uint64_t)==8>
Thanks! I have created https://trac.cppcheck.net/ticket/11171
Log in to post a comment.
cppcheck (2.8) is not able to understand that a return type declared as:
std::enable_if_t<sizeof(uint64_t_==8> is void.</sizeof(uint64_t_==8>
Example:
cppcheck reports: Found a exit path from function with non-void return type that has missing return statement
note that if the return type is declared as:
std::enable_if<sizeof(uint64_t)==8>::type then cppcheck recognize the return type as void.</sizeof(uint64_t)==8>
Last edit: Gaetano Mendola 2022-06-27
Thanks! I have created https://trac.cppcheck.net/ticket/11171