[Bug libstdc++/57899] bind/function with data member: infinite recursion

2014-01-08 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

 CC||rafal at rawicki dot org

--- Comment #8 from Jonathan Wakely redi at gcc dot gnu.org ---
*** Bug 59721 has been marked as a duplicate of this bug. ***


[Bug libstdc++/57899] bind/function with data member: infinite recursion

2014-01-08 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

 CC||eric.niebler at gmail dot com

--- Comment #9 from Jonathan Wakely redi at gcc dot gnu.org ---
*** Bug 59360 has been marked as a duplicate of this bug. ***


[Bug libstdc++/57899] bind/function with data member: infinite recursion

2013-10-21 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC||joerg.rich...@pdv-fs.de

--- Comment #7 from Paolo Carlini paolo.carlini at oracle dot com ---
*** Bug 58825 has been marked as a duplicate of this bug. ***


[Bug libstdc++/57899] bind/function with data member: infinite recursion

2013-09-18 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899

--- Comment #5 from Jonathan Wakely redi at gcc dot gnu.org ---
Reduced a bit more to only depend on std::bind

#include functional
using std::bind;
using std::placeholders::_1;

struct S { int i; };

struct P { S s; };

struct get_s
{
const S operator()(const P p) const { return p.s; }
} gs;

int gi(const S s) { return s.i; }

bool cmp(int, int) { return true; }

int main()
{
P p{};
auto f1 = bind(gs, _1);
auto f2 = bind(gi, f1);
auto f3 = bind(cmp, f2, 5);
f3(p);
}


[Bug libstdc++/57899] bind/function with data member: infinite recursion

2013-09-18 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899

--- Comment #6 from Jonathan Wakely redi at gcc dot gnu.org ---
Clang compiles the preprocessed source OK, so the problem may be in the
front-end not the library.

Commenting out the volatile and const volatile overloads of _Bind::operator()
allows the program to compile with G++.


[Bug libstdc++/57899] bind/function with data member: infinite recursion

2013-07-21 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC||jwakely.gcc at gmail dot com

--- Comment #3 from Paolo Carlini paolo.carlini at oracle dot com ---
Do we know if this is a library or a c++ front-end issue? In the latter case
should be reduced a lot more...


[Bug libstdc++/57899] bind/function with data member: infinite recursion

2013-07-21 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899

--- Comment #4 from Jonathan Wakely redi at gcc dot gnu.org ---
I think it's the library, but haven't been able to reduce it yet.

With only one nested bind expressions the code works, but with a second nested
bind it fails.


[Bug libstdc++/57899] bind/function with data member: infinite recursion

2013-07-15 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-07-15
  Component|c++ |libstdc++
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely redi at gcc dot gnu.org ---
N.B. you can simplify
 bind(pairconst string, int::first, _1); 
to:
mem_fn(pairconst string, int::first);
although that doesn't fix the problem.


[Bug libstdc++/57899] bind/function with data member: infinite recursion

2013-07-15 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899

--- Comment #2 from Jonathan Wakely redi at gcc dot gnu.org ---
Reduced slightly:

#include string
#include functional
using namespace std;
using namespace std::placeholders;

int main()
{
pairstring, int table = {0123456789012345, 0};
auto get_first = mem_fn(pairstring, int::first);

auto it = bind(greatersize_t(), bind(string::length, bind(get_first,
_1)), 5);
it(table);
}