From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25904 invoked by alias); 15 Jul 2013 18:19:06 -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 21456 invoked by uid 48); 15 Jul 2013 18:17:05 -0000 From: "bolero.murakami at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57901] New: [C++11][constexpr] Cannot call-by-value such that class has non-trivial (constexpr) move constructor Date: Mon, 15 Jul 2013 18:19: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.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bolero.murakami at gmail dot com 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: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg00748.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D57901 Bug ID: 57901 Summary: [C++11][constexpr] Cannot call-by-value such that class has non-trivial (constexpr) move constructor Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bolero.murakami at gmail dot com Code: //-------- struct Z { Z() =3D default; Z(Z const&) =3D default; constexpr Z(Z&&) {} /* non-trivial (constexpr) move ctor */ }; template constexpr int fn0(T v) { return 0; } template constexpr int fn (T v) { return fn0(v); } constexpr auto t0 =3D fn0(Z()); // OK! constexpr auto t =3D fn (Z()); // error! (GCC 4.8.1, -std=3Dc++11) //-------- Error message: in constexpr expansion of =E2=80=98fn(Z())=E2=80=99 error: =E2=80=98v=E2=80=99 is not a constant expression constexpr auto t =3D fn(Z()); ^ Class Z is literal type. However, compilation error when it is call-by-value(more than once). I tested this code in gcc-4.7.3, is passed. The problem is reproduced in gcc-4.8.0, gcc-4.8.1 >>From gcc-bugs-return-426242-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jul 15 19:25:27 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 31733 invoked by alias); 15 Jul 2013 19:25:27 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 26683 invoked by uid 48); 15 Jul 2013 19:23:23 -0000 From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52669] No warning in unused private variable in modules Date: Mon, 15 Jul 2013 19:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.7.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: minor X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: 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: 2013-07/txt/msg00749.txt.bz2 Content-length: 482 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52669 Thomas Koenig changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #3 from Thomas Koenig --- Tobias, thanks for posting the commit message. Fixed, closing.