title: Overloading a super class's function
body: <p>Is there something in the C++ standard that prevents me from overloading a super class's function?</p>
  
  <p>Starting with this pair of classes:</p>
  
  <pre><code>class A {            // super class
      int x;
  
  public:
      void foo (int y) {x = y;}  // original definition
  };
  
  class B : public A { // derived class
      int x2;
  
  public:
      void foo (int y, int z) {x2 = y + z;}  // overloaded
  };
  </code></pre>
  
  <p>I can call <code>B::foo()</code> easily:</p>
  
  <pre><code>    B b;
      b.foo (1, 2);  // [1]
  </code></pre>
  
  <p>But if I try to call <code>A::foo()</code> ...</p>
  
  <pre><code>    B b;
      b.foo (12);    // [2]
  </code></pre>
  
  <p>... I get a compiler error:</p>
  
  <pre><code>test.cpp: In function 'void bar()':
  test.cpp:18: error: no matching function for call to 'B::foo(int)'
  test.cpp:12: note: candidates are: void B::foo(int, int)
  </code></pre>
  
  <p>Just to make sure I wasn't missing something, I changed the name of <code>B</code>'s function so that there is no overload:</p>
  
  <pre><code>class B : public A {
      int x2;
  
  public:
      void stuff (int y, int z) {x2 = y + z;}  // unique name
  };
  </code></pre>
  
  <p>And now I can call <code>A::foo()</code> using the second example.</p>
  
  <p>Is this standard? I'm using g++.</p>