title: Is this incorrect use of std::bind or a compiler bug?
body: <p>I am using the latest snapshot build of clang with latest TDM-Gcc headers and libs. When compiling this (using -std=c++11 flag):</p>
  
  <pre><code>#include &lt;functional&gt;
  #include &lt;iostream&gt;
  
  class Foo
  {
      public:
          void Bar(int x)
          {
              std::cout &lt;&lt; x &lt;&lt; std::endl;
          }
  };
  
  int main()
  {
      Foo foo;
      auto f = std::bind(&amp;Foo::Bar, &amp;foo, 5);
      f();
      return 0;
  }
  </code></pre>
  
  <p>I get these errors:</p>
  
  <pre><code>In file included from Test.cpp:1:
  C:\DevEnv\LLVM38\lib\gcc\mingw32\5.1.0\include\c++\functional:1426:7: error: static_assert failed "Wrong number of arguments for pointer-to-member"
        static_assert(_Varargs::value
        ^             ~~~~~~~~~~~~~~~
  C:\DevEnv\LLVM38\lib\gcc\mingw32\5.1.0\include\c++\functional:1440:7: note: in instantiation of template class 'std::_Bind_check_arity&lt;void (Foo::*)(int) __attribute__((thiscall)), Foo *, int&gt;' requested here
      : _Bind_check_arity&lt;typename decay&lt;_Func&gt;::type, _BoundArgs...&gt;
        ^
  C:\DevEnv\LLVM38\lib\gcc\mingw32\5.1.0\include\c++\functional:1461:5: note: in instantiation of template class 'std::_Bind_helper&lt;false, void (Foo::*)(int) __attribute__((thiscall)), Foo *, int&gt;' requested here
      _Bind_helper&lt;__is_socketlike&lt;_Func&gt;::value, _Func, _BoundArgs...&gt;::type
      ^
  Test.cpp:16:14: note: while substituting deduced template arguments into function template 'bind' [with _Func = void (Foo::*)(int) __attribute__((thiscall)), _BoundArgs = &lt;Foo *, int&gt;]
      auto f = std::bind(&amp;Foo::Bar, &amp;foo, 5);
               ^
  Test.cpp:16:14: error: no matching function for call to 'bind'
      auto f = std::bind(&amp;Foo::Bar, &amp;foo, 5);
               ^~~~~~~~~
  C:\DevEnv\LLVM38\lib\gcc\mingw32\5.1.0\include\c++\functional:1490:5: note: candidate template ignored: couldn't infer template argument '_Result'
      bind(_Func&amp;&amp; __f, _BoundArgs&amp;&amp;... __args)
      ^
  C:\DevEnv\LLVM38\lib\gcc\mingw32\5.1.0\include\c++\functional:1462:5: note: candidate template ignored: substitution failure [with _Func = void (Foo::*)(int) __attribute__((thiscall)), _BoundArgs = &lt;Foo *, int&gt;]
      bind(_Func&amp;&amp; __f, _BoundArgs&amp;&amp;... __args)
      ^
  2 errors generated.
  </code></pre>
  
  <p>Am i misusing std::bind or is this some weird compiler error? It seems to compile fine using just TDM Gcc.</p>