From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9823 invoked by alias); 2 Oct 2014 02:26:01 -0000 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 Received: (qmail 9158 invoked by uid 48); 2 Oct 2014 02:25:53 -0000 From: "flast at flast dot jp" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/63437] New: [4.9/5 regression][C++14] Parenthesized "movable but not copyable" object doesn't compile in return statement Date: Thu, 02 Oct 2014 02:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: flast at flast dot jp X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-10/txt/msg00102.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63437 Bug ID: 63437 Summary: [4.9/5 regression][C++14] Parenthesized "movable but not copyable" object doesn't compile in return statement Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: flast at flast dot jp After GCC 4.9, parenthesized "movable but not copyable" object doesn't compile in return statement under C++14 mode (C++11 mode does compile). I'm not sure that the behavior was changed in C++14 spec; Clang seems compile under both of C++11/14 mode. example: ---- struct X // movable but not copyable { X() = default; X(X &&) = default; X(const X &) = delete; }; X non_parenthesized() { X x; return x; // works } X parenthesized() { X x; return (x); // error: use of deleted function 'X::X(const X&)' } ---- Online compiler results: - GCC 4.8.2 - C++11 http://melpon.org/wandbox/permlink/lRR60fvDgKfqd0UZ - C++14 http://melpon.org/wandbox/permlink/BAdrBmEG3euQLnqv - GCC 4.9.1 - C++11 http://melpon.org/wandbox/permlink/XllfUNu0VV0mnYsu - C++14 http://melpon.org/wandbox/permlink/qm67F6vODyADgKvQ (fail) - GCC 5.0 20141001 - C++11 http://melpon.org/wandbox/permlink/21bPbcuXB7S87DUG - C++14 http://melpon.org/wandbox/permlink/da8AeqX7HrS17T2n (fail) - Clang 3.5.0 - C++11 http://melpon.org/wandbox/permlink/VqgnlKRTOBHd5IDt - C++14 http://melpon.org/wandbox/permlink/tAkgLiaD50nOMtEz