http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54506
Bug #: 54506
Summary: Defaulted move constructors and move assignment
operators are erroneously defined as deleted
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
g++ rejects the following well-formed code:
template <class T>
struct A
{
A() {}
A(A const volatile &&) = delete;
A &operator =(A const volatile &&) = delete;
template <class U>
A(A<U> &&) {}
template <class U>
A &operator =(A<U> &&) { return *this; }
};
struct B
{
A<int> a;
B() = default;
B(B &&) = default;
B &operator =(B &&) = default;
};
int main()
{
B b = B();
b = B();
}
The compiler says that the defaulted move functions in B are deleted, however
12.8/11 and 12.8/23 do not define such functions as deleted.