Menu

False positive shadowVariable report when using static class function

2022-01-13
2022-01-20
  • Anton Davidenko

    Anton Davidenko - 2022-01-13

    example:

    struct S
    {
        int i;
    
        static int foo()
        {
            int i = 0;
            return i;
        }
    };
    
     
  • Daniel Marjamäki

    Thanks! I guess it could be argued that it can be considered a shadow variable. But we don't want to be overly picky, I have created this ticket: https://trac.cppcheck.net/ticket/10752

     

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.