title: accessing a protected member of a base class in another subclass
body: <p>Why does this compile:</p>
  
  <pre><code>class FooBase
  {
  protected:
      void fooBase(void);
  };
  
  class Foo : public FooBase
  {
  public:
      void foo(Foo&amp; fooBar)
      {
          fooBar.fooBase();
      }
  };
  </code></pre>
  
  <p>but this does not?</p>
  
  <pre><code>class FooBase
  {
  protected:
      void fooBase(void);
  };
  
  class Foo : public FooBase
  {
  public:
      void foo(FooBase&amp; fooBar)
      {
          fooBar.fooBase();
      }
  };
  </code></pre>
  
  <p>On the one hand C++ grants access to private/protected members for all instances of that class, but on the other hand it does not grant access to protected members of a base class for all instances of a subclass.
  This looks rather inconsistent to me.</p>
  
  <p>I have tested compiling with VC++ and with ideone.com and both compile the first but not the second code snippet.</p>