The code
int main(int argc, char * argv[]) { const int a = [=]() { if (argc < 1) { return 0; } return 1; }(); if (argc < 1) { return 1; } return 5*a; }
produces
lambda-return.cpp:9:11: style: Condition 'argc<1' is always false [knownConditionTrueFalse] if (argc < 1) { ^ lambda-return.cpp:3:12: note: Assuming condition 'argc<1' is false if (argc < 1) { ^ lambda-return.cpp:9:11: note: Condition 'argc<1' is always false if (argc < 1) { ^
This reproduces for me in v2.3.
Thanks! I can reproduce with cppcheck 2.3 but not with latest head. I think it has been fixed.
Log in to post a comment.
The code
produces
This reproduces for me in v2.3.
Thanks! I can reproduce with cppcheck 2.3 but not with latest head. I think it has been fixed.