Bug 56317 - inheriting constructor fails to move brace-initialized object
Summary: inheriting constructor fails to move brace-initialized object
Status: RESOLVED DUPLICATE of bug 56285
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-14 09:33 UTC by David Krauss
Modified: 2013-02-14 09:56 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Krauss 2013-02-14 09:33:33 UTC
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.
Comment 1 David Krauss 2013-02-14 09:35:12 UTC
(But, perfect forwarding equivalent to the inheriting constructor semantic does work around the issue.)
Comment 2 Jonathan Wakely 2013-02-14 09:56:15 UTC
dup of PR 56285

*** This bug has been marked as a duplicate of bug 56285 ***