From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8893 invoked by alias); 9 Sep 2012 20:55:54 -0000 Received: (qmail 8883 invoked by uid 22791); 9 Sep 2012 20:55:53 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 09 Sep 2012 20:55:39 +0000 From: "tsoae at mail dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/54506] Defaulted move constructors and move assignment operators are erroneously defined as deleted Date: Sun, 09 Sep 2012 20:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tsoae at mail dot ru X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-09/txt/msg00735.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D54506 --- Comment #3 from Nikolka 2012-09-09 20:55:38 UTC = --- g++ v4.7.2 20120908 (prerelease) compiles the original example successfully, but it fails to compile the following code: template struct A { A() {} A(A const volatile &&) =3D delete; A &operator =3D(A const volatile &&) =3D delete; template A(A &&) {} template A &operator =3D(A &&) { return *this; } }; struct B { A a; B() =3D default; }; int main() { B b =3D B(); b =3D B(); } Target: i686-pc-linux-gnu Configured with: ../configure --prefix=3D../target --enable-languages=3Dc,c= ++ Thread model: posix gcc version 4.7.2 20120908 (prerelease) (GCC)=20 COLLECT_GCC_OPTIONS=3D'-v' '-std=3Dc++11' '-shared-libgcc' '-mtune=3Dgeneri= c' '-march=3Dpentiumpro' ../target/libexec/gcc/i686-pc-linux-gnu/4.7.2/cc1plus -quiet -v -D_GNU_SOU= RCE test.cpp -quiet -dumpbase test.cpp -mtune=3Dgeneric -march=3Dpentiumpro -au= xbase test -std=3Dc++11 -version -o /tmp/cc0973J0.s GNU C++ (GCC) version 4.7.2 20120908 (prerelease) (i686-pc-linux-gnu) compiled by GNU C version 4.7.2 20120908 (prerelease), GMP version 5.0.= 2, MPFR version 3.1.0, MPC version 0.8.2 test.cpp: In function =E2=80=98int main()=E2=80=99: test.cpp:23:17: error: use of deleted function =E2=80=98B::B(const B&)=E2= =80=99 test.cpp:15:12: note: =E2=80=98B::B(const B&)=E2=80=99 is implicitly delete= d because the default definition would be ill-formed: test.cpp:15:12: error: use of deleted function =E2=80=98constexpr A::A= (const A&)=E2=80=99 test.cpp:2:16: note: =E2=80=98constexpr A::A(const A&)=E2=80=99 i= s implicitly declared as deleted because =E2=80=98A=E2=80=99 declares a move constr= uctor or move assignment operator test.cpp:24:15: error: use of deleted function =E2=80=98B& B::operator=3D(c= onst B&)=E2=80=99 test.cpp:15:12: note: =E2=80=98B& B::operator=3D(const B&)=E2=80=99 is impl= icitly deleted because the default definition would be ill-formed: test.cpp:15:12: error: use of deleted function =E2=80=98A& A::ope= rator=3D(const A&)=E2=80=99 test.cpp:2:16: note: =E2=80=98A& A::operator=3D(const A&)=E2= =80=99 is implicitly declared as deleted because =E2=80=98A=E2=80=99 declares a move constr= uctor or move assignment operator