public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61080] New: Spurious no return statement warning with deleted operators
@ 2014-05-06 17:46 jamborm at gcc dot gnu.org
  2014-05-06 18:14 ` [Bug c++/61080] " jamborm at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: jamborm at gcc dot gnu.org @ 2014-05-06 17:46 UTC (permalink / raw)
  To: gcc-bugs

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

            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=return-type  -fpermissive -fno-rtti
-fno-exceptions -fno-math-errno -std=gnu++0x 2.C -S

2.C: In instantiation of ‘WeakMapPtr<K, V>& WeakMapPtr<K, V>::operator=(const
WeakMapPtr<K, V>&) [with K = JSObject*; V = JSObject*]’:
2.C:32:16:   required from here
2.C:16:17: error: no return statement in function returning non-void
[-Werror=return-type]
     WeakMapPtr &operator=(const WeakMapPtr &wmp) = delete;
                 ^
cc1plus: some warnings being treated as errors

$ cat 2.C
struct AAA
{
  int a1, a2, a3;
  void *p;
};

template <typename K, typename V>
class WeakMapPtr
{
  public:
    WeakMapPtr() : ptr(nullptr) {};
    bool init(AAA *cx);
  private:
    void *ptr;
    WeakMapPtr(const WeakMapPtr &wmp) = delete;
    WeakMapPtr &operator=(const WeakMapPtr &wmp) = delete;
};

template <typename K, typename V>
bool WeakMapPtr<K, V>::init(AAA *cx)
{
    ptr = cx->p;
    return true;
}

struct JSObject
{
  int blah;
  float meh;
};

template class WeakMapPtr<JSObject*, JSObject*>;
>From gcc-bugs-return-450699-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 06 18:00:39 2014
Return-Path: <gcc-bugs-return-450699-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
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: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
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" <gcc-bugzilla@gcc.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: <bug-61075-4-ufp7gxyhQm@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61075-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61075-4@http.gcc.gnu.org/bugzilla/>
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?ida075

Jonathan Wakely <redi at gcc dot gnu.org> 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 <redi at gcc dot gnu.org> ---
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<iterator_traits<Iter>::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)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-05-07 14:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-06 17:46 [Bug c++/61080] New: Spurious no return statement warning with deleted operators jamborm at gcc dot gnu.org
2014-05-06 18:14 ` [Bug c++/61080] " jamborm at gcc dot gnu.org
2014-05-06 18:31 ` paolo.carlini at oracle dot com
2014-05-06 18:41 ` paolo.carlini at oracle dot com
2014-05-06 23:10 ` jason at gcc dot gnu.org
2014-05-06 23:48 ` paolo.carlini at oracle dot com
2014-05-07  0:24 ` paolo.carlini at oracle dot com
2014-05-07  1:02 ` jason at gcc dot gnu.org
2014-05-07  8:26 ` [Bug c++/61080] [4.10 Regression] " paolo.carlini at oracle dot com
2014-05-07 14:31 ` paolo at gcc dot gnu.org
2014-05-07 14:31 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).