Menu

False positive unassignedVariable

2022-01-17
2022-01-18
  • Anton Davidenko

    Anton Davidenko - 2022-01-17

    Example:

    std::map<std::string, int > m = { {"abc", 42 } };
    for (const auto& [name, value] : m) //  Variable 'name' is not assigned a value. [unassignedVariable]
    {
        std::cout << name << std::endl;
    }
    
     

    Last edit: Anton Davidenko 2022-01-17
  • CHR

    CHR - 2022-01-18

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/10743

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.