public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/48541] New: std::function(std::_Function_base) should use std::addressof
@ 2011-04-10 13:43 n.fujita12 at gmail dot com
2011-04-10 13:59 ` [Bug libstdc++/48541] " redi at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: n.fujita12 at gmail dot com @ 2011-04-10 13:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48541
Summary: std::function(std::_Function_base) should use
std::addressof
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: n.fujita12@gmail.com
In std::_Function_base::_M_get_pointer, operator & is used to get a pointer of
the functor.
So, some callable objects which override operator & and they don't return their
pointer couldn't be held by std::function.
----
struct X {
void operator ()() const {
std::cerr << "X()\n";
}
float operator &() const {
return 1.2345;
}
};
int main() {
X x;
std::function<void ()> f(x);
return 0;
}
----
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/48541] std::function(std::_Function_base) should use std::addressof
2011-04-10 13:43 [Bug libstdc++/48541] New: std::function(std::_Function_base) should use std::addressof n.fujita12 at gmail dot com
@ 2011-04-10 13:59 ` redi at gcc dot gnu.org
2011-04-10 16:29 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-10 13:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48541
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.04.10 13:58:50
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/48541] std::function(std::_Function_base) should use std::addressof
2011-04-10 13:43 [Bug libstdc++/48541] New: std::function(std::_Function_base) should use std::addressof n.fujita12 at gmail dot com
2011-04-10 13:59 ` [Bug libstdc++/48541] " redi at gcc dot gnu.org
@ 2011-04-10 16:29 ` redi at gcc dot gnu.org
2011-04-10 16:36 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-10 16:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48541
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-10 16:29:09 UTC ---
Author: redi
Date: Sun Apr 10 16:29:05 2011
New Revision: 172242
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172242
Log:
2011-04-10 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/48541
* include/std/functional (_Base_manager::_M_get_pointer): Use
addressof.
* testsuite/20_util/function/48541.cc: New.
Added:
branches/gcc-4_6-branch/libstdc++-v3/testsuite/20_util/function/48451.cc
Modified:
branches/gcc-4_6-branch/libstdc++-v3/ChangeLog
branches/gcc-4_6-branch/libstdc++-v3/include/std/functional
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/48541] std::function(std::_Function_base) should use std::addressof
2011-04-10 13:43 [Bug libstdc++/48541] New: std::function(std::_Function_base) should use std::addressof n.fujita12 at gmail dot com
2011-04-10 13:59 ` [Bug libstdc++/48541] " redi at gcc dot gnu.org
2011-04-10 16:29 ` redi at gcc dot gnu.org
@ 2011-04-10 16:36 ` redi at gcc dot gnu.org
2011-04-10 16:37 ` redi at gcc dot gnu.org
2011-04-11 18:32 ` paolo.carlini at oracle dot com
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-10 16:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48541
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-10 16:36:01 UTC ---
Author: redi
Date: Sun Apr 10 16:35:58 2011
New Revision: 172244
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172244
Log:
2011-04-10 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/48541
* include/std/functional (_Base_manager::_M_get_pointer): Use
addressof.
* testsuite/20_util/function/48541.cc: New.
Added:
trunk/libstdc++-v3/testsuite/20_util/function/48541.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/std/functional
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/48541] std::function(std::_Function_base) should use std::addressof
2011-04-10 13:43 [Bug libstdc++/48541] New: std::function(std::_Function_base) should use std::addressof n.fujita12 at gmail dot com
` (2 preceding siblings ...)
2011-04-10 16:36 ` redi at gcc dot gnu.org
@ 2011-04-10 16:37 ` redi at gcc dot gnu.org
2011-04-11 18:32 ` paolo.carlini at oracle dot com
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-10 16:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48541
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.6.1
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-10 16:36:57 UTC ---
fixed for 4.6.1 - thanks for the report
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/48541] std::function(std::_Function_base) should use std::addressof
2011-04-10 13:43 [Bug libstdc++/48541] New: std::function(std::_Function_base) should use std::addressof n.fujita12 at gmail dot com
` (3 preceding siblings ...)
2011-04-10 16:37 ` redi at gcc dot gnu.org
@ 2011-04-11 18:32 ` paolo.carlini at oracle dot com
4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-04-11 18:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48541
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-04-11 18:32:12 UTC ---
Thanks Jon.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-04-11 18:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-10 13:43 [Bug libstdc++/48541] New: std::function(std::_Function_base) should use std::addressof n.fujita12 at gmail dot com
2011-04-10 13:59 ` [Bug libstdc++/48541] " redi at gcc dot gnu.org
2011-04-10 16:29 ` redi at gcc dot gnu.org
2011-04-10 16:36 ` redi at gcc dot gnu.org
2011-04-10 16:37 ` redi at gcc dot gnu.org
2011-04-11 18:32 ` 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).