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++/55017] New: [C++11] Rvalue-reference member should cause copy constructor not deleted, but still declared


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)


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