enabled modernize-use-trailing-return-type clang-tidy check and fixed lamdba-related warnings only#7750
enabled modernize-use-trailing-return-type clang-tidy check and fixed lamdba-related warnings only#7750firewave wants to merge 2 commits into
modernize-use-trailing-return-type clang-tidy check and fixed lamdba-related warnings only#7750Conversation
| if (Token::simpleMatch(args[1], "(") && Token::simpleMatch(args[1]->astOperand1(), ". c_str") && args[1]->astOperand1()->astOperand1()) { | ||
| const std::list<ValueFlow::Value>& contValues = args[1]->astOperand1()->astOperand1()->values(); | ||
| auto it = std::find_if(contValues.cbegin(), contValues.cend(), [](const ValueFlow::Value& value) { | ||
| auto it = std::find_if(contValues.cbegin(), contValues.cend(), [](const ValueFlow::Value& value) -> bool { |
There was a problem hiding this comment.
I dont think we should be adding an explicit return type on lambdas when it can be deduced.
There was a problem hiding this comment.
It helps to deduce issue if you accidentally change the result. I had had such a case where I returned a wrong variable but it was accepted since the result was implicitly casted later on. It also helps with readability in case of bigger lambdas.
There is also a long-standing shortcoming in Clang (no idea bout others) with auto-deduced types generating worse code (I do not have the ticket handy right now).
There was a problem hiding this comment.
There is also a long-standing shortcoming in Clang (no idea bout others) with auto-deduced types generating worse code (I do not have the ticket handy right now).
…ed lamdba-related warnings only
|



No description provided.