This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/56317] New: inheriting constructor fails to move brace-initialized object


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]