<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - not1 + mem_fn does not work together"
   href="http://llvm.org/bugs/show_bug.cgi?id=21026">21026</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>not1 + mem_fn does not work together
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>thomas.sanchz@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,
While nesting algorithms and functor I stumble upon a code that does not
compile:

#include <functional>
#include <algorithm>

struct Test { bool pred() const { return true; } };
int main(int argc, char *argv[])
{
  Test* t = nullptr;

  // does not work: error: no matching function for call to object of type
'const std::__1::__mem_fn<bool (Test::*)() const>
  auto f1 = std::not1(std::mem_fn(&Test::pred));
  f1(t);
  // works
  auto f2 = std::not1(std::mem_fun(&Test::pred));
  f2(t);
  // works
  auto f3 = std::not1(std::bind(&Test::pred, std::placeholders::_1));
  f3(t);
}

Compiled with: clang++ -O0 -Wall -std=c++11 test.cpp on Mac OS X:
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix


Funny thing, with GCC, it is f3 which do not compile :)
Thanks,</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>