On Thu, 19 Jun 2014, Jason Merrill wrote:
We were treating a const & member function like a normal const reference, and
binding an rvalue object argument to it. But it doesn't work that way.
That looks weird to me. The const&& version is a better match than the
const&, so we should pick that one in overload resolution, but if we
remove the const&& version, the other one seems valid to me, we shouldn't
reject this program:
struct Type
{
void get() const& { }
};
int main()
{
Type{}.get();
}
At least both clang and intel accept it, and I hope the standard didn't
make it behave differently from regular function calls.
--
Marc Glisse