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++/54506] New: Defaulted move constructors and move assignment operators are erroneously defined as deleted


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54506

             Bug #: 54506
           Summary: Defaulted move constructors and move assignment
                    operators are erroneously defined as deleted
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tsoae@mail.ru


g++ rejects the following well-formed code:

    template <class T>
        struct A
    {
        A() {}

        A(A const volatile &&) = delete;
        A &operator =(A const volatile &&) = delete;

        template <class U>
            A(A<U> &&) {}
        template <class U>
            A &operator =(A<U> &&) { return *this; }
    };

    struct B
    {
        A<int> a;
        B() = default;
        B(B &&) = default;
        B &operator =(B &&) = default;
    };

    int main()
    {
        B b = B();
        b = B();
    }
The compiler says that the defaulted move functions in B are deleted, however
12.8/11 and 12.8/23 do not define such functions as deleted.


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