public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/53872] New: [C++11] ADL bug in std::thread
@ 2012-07-06 12:13 frankhb1989 at gmail dot com
2012-07-06 13:09 ` [Bug libstdc++/53872] " paolo.carlini at oracle dot com
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: frankhb1989 at gmail dot com @ 2012-07-06 12:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53872
Bug #: 53872
Summary: [C++11] ADL bug in std::thread
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: frankhb1989@gmail.com
Code below fails to compile using mingw-g++4.7.1 from
sourceforge.net/projects/mingwbuilds:
#include <thread>
#include <memory>
#include <functional>
template<typename, typename...P>
void make_shared(P&&...)
{}
struct C{}; // enable ADL
void f(C){}
int main()
{
std::thread t(std::bind(&::f, C())); //error
}
Messages:
d:\mingw\bin\..\lib\gcc\i686-w64-mingw32\4.7.1\include\c++\thread||In
instantiation of 'std::shared_ptr<std::thread::_Impl<_Callable> >
std::thread::_M_make_routine(_Callable&&) [with _Callable =
std::_Bind_simple<std::_Bind<void (*(C))(C)>()>]':|
d:\mingw\bin\..\lib\gcc\i686-w64-mingw32\4.7.1\include\c++\thread|133|required
from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable =
std::_Bind<void (*(C))(C)>; _Args = {}]'|
F:\Programing\Temp\T9.cpp|31|required from here|
d:\mingw\bin\..\lib\gcc\i686-w64-mingw32\4.7.1\include\c++\thread|191|sorry,
unimplemented: use of 'type_pack_expansion' in template|
d:\mingw\bin\..\lib\gcc\i686-w64-mingw32\4.7.1\include\c++\thread|191|sorry,
unimplemented: use of 'type_pack_expansion' in template|
d:\mingw\bin\..\lib\gcc\i686-w64-mingw32\4.7.1\include\c++\thread|191|error:
call of overloaded 'make_shared(std::_Bind_simple<std::_Bind<void
(*(C))(C)>()>)' is ambiguous|
d:\mingw\bin\..\lib\gcc\i686-w64-mingw32\4.7.1\include\c++\thread|191|note:
candidates are:|
d:\mingw\bin\..\lib\gcc\i686-w64-mingw32\4.7.1\include\c++\bits\shared_ptr.h|611|note:
std::shared_ptr<_Tp1> std::make_shared(_Args&& ...) [with _Tp =
std::thread::_Impl<std::_Bind_simple<std::_Bind<void (*(C))(C)>()> >; _Args =
{std::_Bind_simple<std::_Bind<void (*(C))(C)>()>}]|
F:\Programing\Temp\T9.cpp|22|note: void make_shared(P&& ...) [with
<template-parameter-1-1> = std::thread::_Impl<std::_Bind_simple<std::_Bind<void
(*(C))(C)>()> >; P = {std::_Bind_simple<std::_Bind<void (*(C))(C)>()>}]|
The line 191 of <thread>(in member template _M_make_routine):
return make_shared<_Impl<_Callable>>(std::forward<_Callable>(__f));
After I adding "std::" before "make_shared", it works fine.
Note: there is something wrong with the error message("unimplemented"). I'd
file another bug for it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/53872] [C++11] ADL bug in std::thread
2012-07-06 12:13 [Bug libstdc++/53872] New: [C++11] ADL bug in std::thread frankhb1989 at gmail dot com
@ 2012-07-06 13:09 ` paolo.carlini at oracle dot com
2012-07-06 13:56 ` paolo at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-07-06 13:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53872
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2012-07-06
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
Target Milestone|--- |4.7.2
Ever Confirmed|0 |1
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-07-06 13:09:28 UTC ---
Mine.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/53872] [C++11] ADL bug in std::thread
2012-07-06 12:13 [Bug libstdc++/53872] New: [C++11] ADL bug in std::thread frankhb1989 at gmail dot com
` (2 preceding siblings ...)
2012-07-06 13:56 ` paolo at gcc dot gnu.org
@ 2012-07-06 13:56 ` paolo at gcc dot gnu.org
2012-07-06 13:59 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-07-06 13:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53872
--- Comment #2 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-07-06 13:56:04 UTC ---
Author: paolo
Date: Fri Jul 6 13:55:58 2012
New Revision: 189329
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189329
Log:
2012-07-06 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/53872
* include/std/thread (thread::_M_make_routine): Qualify make_shared
to prevent ADL.
* testsuite/30_threads/thread/adl.cc: New.
Added:
trunk/libstdc++-v3/testsuite/30_threads/thread/adl.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/std/thread
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/53872] [C++11] ADL bug in std::thread
2012-07-06 12:13 [Bug libstdc++/53872] New: [C++11] ADL bug in std::thread frankhb1989 at gmail dot com
2012-07-06 13:09 ` [Bug libstdc++/53872] " paolo.carlini at oracle dot com
@ 2012-07-06 13:56 ` paolo at gcc dot gnu.org
2012-07-06 13:56 ` paolo at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-07-06 13:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53872
--- Comment #2 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-07-06 13:56:04 UTC ---
Author: paolo
Date: Fri Jul 6 13:55:58 2012
New Revision: 189329
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189329
Log:
2012-07-06 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/53872
* include/std/thread (thread::_M_make_routine): Qualify make_shared
to prevent ADL.
* testsuite/30_threads/thread/adl.cc: New.
Added:
trunk/libstdc++-v3/testsuite/30_threads/thread/adl.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/std/thread
--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-07-06 13:56:31 UTC ---
Author: paolo
Date: Fri Jul 6 13:56:24 2012
New Revision: 189330
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189330
Log:
2012-07-06 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/53872
* include/std/thread (thread::_M_make_routine): Qualify make_shared
to prevent ADL.
* testsuite/30_threads/thread/adl.cc: New.
Added:
branches/gcc-4_7-branch/libstdc++-v3/testsuite/30_threads/thread/adl.cc
Modified:
branches/gcc-4_7-branch/libstdc++-v3/ChangeLog
branches/gcc-4_7-branch/libstdc++-v3/include/std/thread
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/53872] [C++11] ADL bug in std::thread
2012-07-06 12:13 [Bug libstdc++/53872] New: [C++11] ADL bug in std::thread frankhb1989 at gmail dot com
2012-07-06 13:09 ` [Bug libstdc++/53872] " paolo.carlini at oracle dot com
2012-07-06 13:56 ` paolo at gcc dot gnu.org
@ 2012-07-06 13:56 ` paolo at gcc dot gnu.org
2012-07-06 13:56 ` paolo at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-07-06 13:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53872
--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-07-06 13:56:31 UTC ---
Author: paolo
Date: Fri Jul 6 13:56:24 2012
New Revision: 189330
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189330
Log:
2012-07-06 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/53872
* include/std/thread (thread::_M_make_routine): Qualify make_shared
to prevent ADL.
* testsuite/30_threads/thread/adl.cc: New.
Added:
branches/gcc-4_7-branch/libstdc++-v3/testsuite/30_threads/thread/adl.cc
Modified:
branches/gcc-4_7-branch/libstdc++-v3/ChangeLog
branches/gcc-4_7-branch/libstdc++-v3/include/std/thread
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/53872] [C++11] ADL bug in std::thread
2012-07-06 12:13 [Bug libstdc++/53872] New: [C++11] ADL bug in std::thread frankhb1989 at gmail dot com
` (3 preceding siblings ...)
2012-07-06 13:56 ` paolo at gcc dot gnu.org
@ 2012-07-06 13:59 ` paolo.carlini at oracle dot com
2012-07-20 7:13 ` ebotcazou at gcc dot gnu.org
2012-07-20 9:13 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-07-06 13:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53872
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-07-06 13:59:27 UTC ---
Fixed mainline and 4.7.2.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/53872] [C++11] ADL bug in std::thread
2012-07-06 12:13 [Bug libstdc++/53872] New: [C++11] ADL bug in std::thread frankhb1989 at gmail dot com
` (4 preceding siblings ...)
2012-07-06 13:59 ` paolo.carlini at oracle dot com
@ 2012-07-20 7:13 ` ebotcazou at gcc dot gnu.org
2012-07-20 9:13 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-07-20 7:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53872
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ebotcazou at gcc dot
| |gnu.org
--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-07-20 07:13:27 UTC ---
The new test fails on older Solaris 8 versions:
Running target unix
FAIL: 30_threads/thread/adl.cc (test for excess errors)
I think you need to add:
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
like in the other tests, e.g id/hash.cc and id/operators.cc.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug libstdc++/53872] [C++11] ADL bug in std::thread
2012-07-06 12:13 [Bug libstdc++/53872] New: [C++11] ADL bug in std::thread frankhb1989 at gmail dot com
` (5 preceding siblings ...)
2012-07-20 7:13 ` ebotcazou at gcc dot gnu.org
@ 2012-07-20 9:13 ` paolo.carlini at oracle dot com
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-07-20 9:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53872
--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-07-20 09:12:50 UTC ---
Oops, I'll fix it momentarily, thanks!
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-07-20 9:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-06 12:13 [Bug libstdc++/53872] New: [C++11] ADL bug in std::thread frankhb1989 at gmail dot com
2012-07-06 13:09 ` [Bug libstdc++/53872] " paolo.carlini at oracle dot com
2012-07-06 13:56 ` paolo at gcc dot gnu.org
2012-07-06 13:56 ` paolo at gcc dot gnu.org
2012-07-06 13:56 ` paolo at gcc dot gnu.org
2012-07-06 13:59 ` paolo.carlini at oracle dot com
2012-07-20 7:13 ` ebotcazou at gcc dot gnu.org
2012-07-20 9:13 ` 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).