[Bug c++/69139] [4.9/5/6 Regression] deduction failure with trailing return type in function template argument

rs2740 at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Feb 7 23:59:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69139

--- Comment #3 from TC <rs2740 at gmail dot com> ---
Another test case, slightly modified from the original in the linked SO
question:

struct X {
  auto get(int) const & -> int { return {}; }
  auto get(int) && -> long { return {}; }
};

template <class R> auto f(auto (X::*)(int) const & -> R) -> R {}

using I = decltype(f(&X::get));
using I = int;

The fix needs to also handle the cv-qualifier-seq and ref-qualifier in the
function type, if any.


More information about the Gcc-bugs mailing list