From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11316 invoked by alias); 18 Sep 2013 11:56:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 11258 invoked by uid 48); 18 Sep 2013 11:56:27 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/57899] bind/function with data member: infinite recursion Date: Wed, 18 Sep 2013 11:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-09/txt/msg01340.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57899 --- Comment #5 from Jonathan Wakely --- Reduced a bit more to only depend on std::bind #include 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); }