voidtest(boola,boolb){if(a){return;}if(a||b){// true positive for identicalConditionAfterEarlyExitreturn;}}template<boola,boolb>constexprvoidtest_constexpr(){ifconstexpr(a){return;}ifconstexpr(a||b){// false negative for identicalConditionAfterEarlyExit if function is called, true positive if it is not calledreturn;}}intmain(){test(true,false);test_constexpr<true,false>();return0;}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Version: e0014e1b023442e9c0e15609658a910c41436356
Thanks for reporting, I have added your example in https://trac.cppcheck.net/ticket/8334
Thanks