title: Why are methods with different signatures "ambiguous" when they come from different base classes?
body: <p>Consider the following example of a class <code>super</code> that inherits from two base classes that each provide a method with same name, but different signatures:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>struct a {};
  struct b {};
  
  class foo {
  public:
    void method(a const &amp;) {}
  };
  
  class bar {
  public:
    void method(b const &amp;) {}
  };
  
  class super : public foo, public bar {
  public:
    void something()
    {
      method(b {}); // &lt;- Ambiguous?
    }
  };
  
  </code></pre>
  
  <p>This fails to compile with GCC and clang due to the compiler claiming that the call to <code>method</code> is ambiguous:</p>
  
  <pre><code>overload.cpp: In member function ‘void super::something()’:
  overload.cpp:18:5: error: reference to ‘method’ is ambiguous
     18 |     method(b {});
        |     ^~~~~~
  overload.cpp:11:8: note: candidates are: ‘void bar::method(const b&amp;)’
     11 |   void method(b const &amp;) {}
        |        ^~~~~~
  overload.cpp:6:8: note:                 ‘void foo::method(const a&amp;)’
      6 |   void method(a const &amp;) {}
        |        ^~~~~~
  </code></pre>
  
  <p>It looks like it is perfectly decidable which method to call depending on the method signature.</p>
  
  <p>Is this failure to resolve the method call a compiler issue or is this behavior mandated by the C++ standard?</p>
  
  <p>Our current workaround is to place <code>using foo::method; using bar::method;</code> declarations in <code>class super</code>. With that the compiler is able to resolve calls to <code>method</code> without problem.</p>