title: gcc Woverloaded-virtual warnings
body: <p>The following C++ code i think is correct, but produce some warnings when compiled with "-Woverloaded-virtual", is the warning bogus or there is a real problem with this code?</p>
  
  <p>If that is a bogus warning what can i do to avoid it, define all the exception virtual variants in derived get rids of the warning but maybe is a better solution</p>
  
  <p>G++ command:</p>
  
  <pre><code>   g++ -c -Woverloaded-virtual test.cpp 
  test.cpp:22:18: warning: ‘virtual void intermediate::exception(const char*)’ was hidden [-Woverloaded-virtual]
  test.cpp:32:18: warning:   by ‘virtual void derived::exception()’ [-Woverloaded-virtual]
  </code></pre>
  
  <p>C++ code</p>
  
  <pre><code>using namespace std;
  
  class base
  {
  public:
  
      virtual void exception() = 0;
      virtual void exception(const char*) = 0;
  };
  
  class intermediate : public base
  {
  public:
  
      virtual void exception()
      {
      cerr &lt;&lt; "unknown exception" &lt;&lt; endl;
      }
  
      virtual void exception(const char* msg)
      {
      cerr &lt;&lt; "exception: " &lt;&lt; msg &lt;&lt; endl;
      }
  };
  
  class derived : public intermediate
  {
  public:
  
      virtual void exception() 
      { 
          intermediate::exception("derived:unknown exception");
      }
  };
  </code></pre>