title: Can't call virtual protected method in derived class
body: <p>The following code does not compile in GCC 4.9.1:</p>
  
  <pre><code>class A
  {
  protected:
     virtual void f() {}
  
  };
  
  class B : public A
  {
  protected:
     virtual void f() override { A* a = new A; a-&gt;f(); }
  };
  </code></pre>
  
  <p>I get the following:</p>
  
  <pre><code>header.h: In member function 'virtual void B::f()':
  header.h:51:17: error: 'virtual void A::f()' is protected
  </code></pre>
  
  <p>I would have expected this to compile.</p>
  
  <p>Why does it fail? Is there a better way than making f() public?</p>