title: gcc -Wshadow is too strict?
body: <p>In the following example:</p>
  
  <pre><code>class A
  {
    public:
      int len();
      void setLen(int len) { len_ = len; } // warning at this line
    private:
      int len_;
  };
  </code></pre>
  
  <p>gcc with -Wshadow issue a warning:</p>
  
  <pre><code>main.cpp:4: warning: declaration of `len' shadows a member of `this'
  </code></pre>
  
  <p>function len and integer len are of different type. Why the warning?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I see there's a wide consensus of what "shadow" means. 
  And from a formal point of view, the compiler does exactly what it's meant to do.</p>
  
  <p>However IMHO, the flag is not practical. For example commonly used setter/getter idiom :</p>
  
  <pre><code>class A {
     void prop(int prop);  // setter
     int prop() const;     // getter
  
     int prop;
  };
  </code></pre>
  
  <p>It would be nice if there was a warning flag that won't issue warning in the case, but will warn in case "int a" hides "int a". </p>
  
  <p>Adding -Wshadow on my legacy code issues tons of warnings, while from time to time I discover bugs caused by "shadowing" problem.</p>
  
  <p>I don't mind how it will be called "-Wmuch_more_practical_and_interesting_shadow" or
  "-Wfoooooo".</p>
  
  <p>So, are there <strong>other</strong> gcc warning flags that do what I described?</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>I'm not the only one who thinks -Wshadow is somehow not useful <a href="http://kerneltrap.org/node/7434" rel="nofollow noreferrer">link text</a>. I'm not alone :)
  Less strict checking could be much more useful.</p>