This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/24818] tr1::reference_wrapper improperly calls nullary function objects
- From: "doug dot gregor at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Nov 2005 13:31:04 -0000
- Subject: [Bug libstdc++/24818] tr1::reference_wrapper improperly calls nullary function objects
- References: <bug-24818-10727@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from doug dot gregor at gmail dot com 2005-11-12 13:31 -------
Created an attachment (id=10225)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10225&action=view)
Mainline (4.1.0) patch to test and fix this problem
The fix is trivial. The changes to the test case cause failures that are fixed
by the patch to ref_wrap_iterate.h. All of the tr1/3_function_objects tests
still pass on i686-pc-linux-gnu.
2005-11-12 Douglas Gregor <doug.gregor@gmail.com>
* include/tr1/ref_wrap_iterate.h
(reference_wrapper::operator()()): Don't dereferene the result of
get() before calling it; it's already a reference.
* testsuite/tr1/3_function_objects/reference_wrapper/invoke.cc:
Test nullary calls to reference_wrappers.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24818