EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.

This change regresses other code. By changing `__bind_return<...>::type` into 
`decltype(auto)` you prevent the member functions from SFINAE'ing. For example:

  #include <functional>
  
  struct Func {
    template <class ...Args>
    void operator()(Args&&...) = delete;
  
    template <class ...Args>
    void operator()(Args&&...) const {}
  };
  
  int main() {
      Func f;
      std::bind(f)(); // Broken after your change.
  }

This patch cannot introduce regressions but changing to using `decltype(auto)` 
does. I'm not sure the behavior you want is possible. The library is required 
to evaluate the validity of calling the specified functor in the signature of 
the call operator in order to correctly SFINAE.
I think this makes accepting the code in PR32856 impossible.


https://reviews.llvm.org/D32824



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to