From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18446 invoked by alias); 6 May 2014 17:46:36 -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 18425 invoked by uid 48); 6 May 2014 17:46:33 -0000 From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61080] New: Spurious no return statement warning with deleted operators Date: Tue, 06 May 2014 17:46: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.10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org 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 cc 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: 2014-05/txt/msg00390.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61080 Bug ID: 61080 Summary: Spurious no return statement warning with deleted operators Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jamborm at gcc dot gnu.org CC: paolo.carlini at oracle dot com Since r210043 I'm getting the following warning which I believe is spurious: $ ~/gcc/small/inst/bin/g++ -Wall -Werror=3Dreturn-type -fpermissive -fno-r= tti -fno-exceptions -fno-math-errno -std=3Dgnu++0x 2.C -S 2.C: In instantiation of =E2=80=98WeakMapPtr& WeakMapPtr::opera= tor=3D(const WeakMapPtr&) [with K =3D JSObject*; V =3D JSObject*]=E2=80=99: 2.C:32:16: required from here 2.C:16:17: error: no return statement in function returning non-void [-Werror=3Dreturn-type] WeakMapPtr &operator=3D(const WeakMapPtr &wmp) =3D delete; ^ cc1plus: some warnings being treated as errors $ cat 2.C struct AAA { int a1, a2, a3; void *p; }; template class WeakMapPtr { public: WeakMapPtr() : ptr(nullptr) {}; bool init(AAA *cx); private: void *ptr; WeakMapPtr(const WeakMapPtr &wmp) =3D delete; WeakMapPtr &operator=3D(const WeakMapPtr &wmp) =3D delete; }; template bool WeakMapPtr::init(AAA *cx) { ptr =3D cx->p; return true; } struct JSObject { int blah; float meh; }; template class WeakMapPtr; >>From gcc-bugs-return-450699-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 06 18:00:39 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 29451 invoked by alias); 6 May 2014 18:00:38 -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 29432 invoked by uid 48); 6 May 2014 18:00:35 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/61075] parallel std::accumulate reduct type cannot be different than the iterated type Date: Tue, 06 May 2014 18:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cf_gcchost 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: 2014-05/txt/msg00391.txt.bz2 Content-length: 1479 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61075 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Host|Linux 3.13.5-gentoo #10 | |SMP Fri Apr 25 16:12:35 | |CEST 2014 x86_64 Intel(R) | |Xeon(R) CPU W3690 @ 3.47GHz | |GenuineIntel GNU/Linux | --- Comment #3 from Jonathan Wakely --- I'm not sure if this is easily fixable. When running in parallel we split the range into N sub-ranges, accumulate over each sub-range, then accumulate the results. This means that we need an "init" value to start accumulating each sub-range, which we get by dereferencing the first iterator in the sub-range. Therefore the parallal accumulate has an additional requirement not present on the serial accumulate: is_convertible::value_type, T> (It also implicitly assumes that the functor is associative.) It might be possible to make it work if we relax the specification, requiring the functor to be commutative and saying it is unspecified whether we call binary_op(init, *first) or binary_op(*first, init), but then the algorithm isn't really std::accumulate (it becomes more like the std::experimental::reduce algorithm from the http://open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3850.pdf draft)