User Activity

  • Modified a comment on discussion Development on cppcheck

    Use of a structured binding in an if statement initializer is an automatic violation of the variableScope rule. The scope of entry is already at the if statement, so it can't actually be reduced futher (unless it's counting the if condition clause itself). It doesn't make much sense in the usage though. #include <map> int main() { std::map<int,int> m; if (auto&& [entry, inserted] = m.emplace(1,2); inserted) { return entry->second; } return 0; } test.cpp:6:14: style: The scope of the variable 'entry'...

  • Modified a comment on discussion Development on cppcheck

    Use of a structured binding in an if statement initializer is an automatic violation of the variableScope rule. The scope of entry is already at the if statement, so it can't actually be reduced futher (unless it's counting the if condition clause itself. It doesn't make much sense in the usage though. #include <map> int main() { std::map<int,int> m; if (auto&& [entry, inserted] = m.emplace(1,2); inserted) { return entry->second; } return 0; } test.cpp:6:14: style: The scope of the variable 'entry'...

  • Posted a comment on discussion Development on cppcheck

    Use of a structured binding in an if statement initializer is an automatic violation of the variableScope rule. While strictly the scope can be reduced, I don't think it makes sense since entry cannot be used outside of the if scope and the cppcheck rule requires disabling on every instance. We should at least have a specific option to disable these cases. #include <map> int main() { std::map<int,int> m; if (auto&& [entry, inserted] = m.emplace(1,2); inserted) { return entry->second; } return 0;...

View All

Personal Data

Username:
dednick
Joined:
2025-11-25 17:01:29.064000

Projects

  • No projects to display.

Personal Tools

MongoDB Logo MongoDB