The following code compiles without problem on gcc 4.8.1:
#include
struct foo
{
};
int main()
{
foo bar;
foo() = bar;
foo() =
It seems like your question is more "Why would assignment to an rvalue ever be useful?" rather than "Why doesn't the standard ref-qualify auto generated constructors?"
The reason assignment to an rvalue is allowed is because there are some cases where it is useful.
One example usage is with std::tie (link):
#include
#include
int main()
{
std::set s;
std::set::iterator iter;
bool inserted;
// unpacks the return value of insert into iter and inserted
std::tie(iter, inserted) = s.insert(7);
}
Example borrowed from cppreference.com then modified