http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60594
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Are you sure this is valid? Instantiating std::function (like most std::lib templates) with an incomplete type is undefined behaviour. Is the function type bar() complete if bar is not complete?