public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/59830] New: std::packaged_task throws exception
@ 2014-01-15 15:55 b17c0de at gmail dot com
  2014-01-15 16:15 ` [Bug libstdc++/59830] " redi at gcc dot gnu.org
  2014-01-16  8:42 ` b17c0de at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: b17c0de at gmail dot com @ 2014-01-15 15:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59830
           Summary: std::packaged_task throws exception
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: b17c0de at gmail dot com

user@domain:~/work/test$ uname -a
Linux domain 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux

user@domain:~/work/test$ g++ --version
g++ (Debian 4.7.2-5) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

user@domain:~/work/test$ cat fut.cc 
#include <iostream>
#include <future>

int main()
{
  std::packaged_task<int()> task([]() { return 42; });
  std::future<int> result = task.get_future();
  task();
  std::cout << "task_lambda:\t" << result.get() << '\n';
}

user@domain:~/work/test$ g++ -std=c++11 -g fut.cc
user@domain:~/work/test$ ./a.out 
terminate called after throwing an instance of 'std::system_error'
  what():  Unknown error 18446744073709551615
Abgebrochen


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

* [Bug libstdc++/59830] std::packaged_task throws exception
  2014-01-15 15:55 [Bug libstdc++/59830] New: std::packaged_task throws exception b17c0de at gmail dot com
@ 2014-01-15 16:15 ` redi at gcc dot gnu.org
  2014-01-16  8:42 ` b17c0de at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2014-01-15 16:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
<future> relies on mutexes and condition variables so you need to compile and
link with -pthread


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

* [Bug libstdc++/59830] std::packaged_task throws exception
  2014-01-15 15:55 [Bug libstdc++/59830] New: std::packaged_task throws exception b17c0de at gmail dot com
  2014-01-15 16:15 ` [Bug libstdc++/59830] " redi at gcc dot gnu.org
@ 2014-01-16  8:42 ` b17c0de at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: b17c0de at gmail dot com @ 2014-01-16  8:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from b17c0de at gmail dot com ---
(In reply to Jonathan Wakely from comment #1)
> <future> relies on mutexes and condition variables so you need to compile
> and link with -pthread

Thanks! That was indeed the problem. Whats with the strange error though?


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

end of thread, other threads:[~2014-01-16  8:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-15 15:55 [Bug libstdc++/59830] New: std::packaged_task throws exception b17c0de at gmail dot com
2014-01-15 16:15 ` [Bug libstdc++/59830] " redi at gcc dot gnu.org
2014-01-16  8:42 ` b17c0de at gmail 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).