title: Why does g++ fail init of std::function<> from type with conversion operator and inaccessible function call operators?
body: <p>This code fails with g++ 4.9 and later (including build from svn current,) but compiles without warning with clang++ and microsofts compiler (from VS2015.)</p>
  
  <pre><code>#include &lt;functional&gt;
  
  struct A {
    void operator()() const {}
  };
  struct B {
    void operator()() const {}
  };
  struct C : private A, private B
  {
    operator std::function&lt;void()&gt;() const { return nullptr; }
  };
  
  int main()
  {
    std::function&lt;void()&gt; f{C{}};
  }
  </code></pre>
  
  <p>The construction of <code>f</code> in <code>main()</code> fails due to <code>operator()</code> being ambiguous in struct <code>C</code>.</p>
  
  <p>Why does g++ consider this to be ambiguous? The function call operators in <code>C</code> are privately inherited and not accessible.
  Adding a private, or explicitly deleted, <code>void operator()() const</code> to struct <code>C</code> makes the code compile and use the conversion operator as intended. Why would these inaccessible operators not cause problems when the inaccessible inherited ones do?</p>