diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c2f870a1770..c17581b3314 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2017-11-22 Jonathan Wakely + + PR go/83102 + * include/bits/stl_tree.h (_Rb_tree): Relax invocable checks for + comparison object pre-C++17. + 2017-11-21 Jonathan Wakely PR libstdc++/48101 diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index ff36618bccf..df92a60d4dd 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -449,9 +449,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef __gnu_cxx::__alloc_traits<_Node_allocator> _Alloc_traits; #if __cplusplus >= 201103L - static_assert(__is_invocable{}, + static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{}, "comparison object must be invocable with two arguments of key type"); -#endif +# if __cplusplus >= 201703L + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 2542. Missing const requirements for associative containers + static_assert(is_invocable_v, + "comparison object must be invocable as const"); +# endif // C++17 +#endif // C++11 protected: typedef _Rb_tree_node_base* _Base_ptr;