This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54506] New: Defaulted move constructors and move assignment operators are erroneously defined as deleted
- From: "tsoae at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Sep 2012 17:50:11 +0000
- Subject: [Bug c++/54506] New: Defaulted move constructors and move assignment operators are erroneously defined as deleted
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: tsoae@mail.ru
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.