This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56317] New: inheriting constructor fails to move brace-initialized object
- From: "potswa at mac dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 14 Feb 2013 09:33:33 +0000
- Subject: [Bug c++/56317] New: inheriting constructor fails to move brace-initialized object
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56317
Bug #: 56317
Summary: inheriting constructor fails to move brace-initialized
object
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: potswa@mac.com
Although p{} in the example below is an rvalue, I get an error "cannot bind âpâ
lvalue to âp&&â."
It does compile if I don't use braces, and change p{} to p().
struct p {};
struct b { b( p && ) {} };
struct d : b { using b::b; };
d o( p{} );
In the original, full program, it doesn't mention a value category, and
changing the braces to () doesn't work around the issue.