https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89942
Bug ID: 89942 Summary: std::function __is_location_invariant breaks ABI compatibility Product: gcc Version: 5.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: kan.liu.229 at gmail dot com Target Milestone: --- Created attachment 46079 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46079&action=edit possible fix in gcc 5.4.0 template<typename _Tp> struct __is_location_invariant : is_trivially_copyable<_Tp>::type { }; __is_location_invariant is evaluated to be true for the closure type (lambda expression) in gcc 4.9.2 template<typename _Tp> struct __is_location_invariant : integral_constant<bool, (is_pointer<_Tp>::value || is_member_pointer<_Tp>::value)> { }; which is evaluated to be false. This may break ABI compatibility when pass function object between libs compiled by 4.9.2 / 5.4.0 gcc. The attachment is a possible fix.