This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55017] New: [C++11] Rvalue-reference member should cause copy constructor not deleted, but still declared
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 22 Oct 2012 07:53:53 +0000
- Subject: [Bug c++/55017] New: [C++11] Rvalue-reference member should cause copy constructor not deleted, but still declared
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55017
Bug #: 55017
Summary: [C++11] Rvalue-reference member should cause copy
constructor not deleted, but still declared
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: daniel.kruegler@googlemail.com
Using gcc 4.8.0 20121014 (experimental) with the compiler flags
-Wall -pedantic -std=c++11
the following code is incorrectly accepted:
//----------------------
struct S {
int&& rr;
S(int&& rr) : rr(static_cast<int&&>(rr)) {}
};
S s1(13);
S s2 = s1; // Should be rejected
//----------------------
This code should be rejected, because a non-static rvalue-reference member
causes the copy-constructor to be deleted as of 12.8 p11 b5. (Note: Even though
12.8 is currently under investigation bei CWG, there are no intentions to
change this part of the wording)