diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2017-11-22 11:06:15 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2017-11-22 11:06:15 +0000 |
commit | e350134d727b80b261d410b62f791fe96a3b3e89 (patch) | |
tree | 13fb585fb676812b68ec399ce12bf5922b47d925 /libstdc++-v3 | |
parent | aaa49b45f6e1fbfc07ae25496b0d9361161a4c80 (diff) | |
download | gcc-e350134d727b80b261d410b62f791fe96a3b3e89.zip gcc-e350134d727b80b261d410b62f791fe96a3b3e89.tar.gz gcc-e350134d727b80b261d410b62f791fe96a3b3e89.tar.bz2 |
PR go/83102 relax std::set checks for invocable comparison object
PR go/83102
* include/bits/stl_tree.h (_Rb_tree): Relax invocable checks for
comparison object pre-C++17.
From-SVN: r255052
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_tree.h | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c2f870a..c17581b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2017-11-22 Jonathan Wakely <jwakely@redhat.com> + + PR go/83102 + * include/bits/stl_tree.h (_Rb_tree): Relax invocable checks for + comparison object pre-C++17. + 2017-11-21 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/48101 diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index ff36618..df92a60 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<const _Compare&, const _Key&, const _Key&>{}, + 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<const _Compare&, const _Key&, const _Key&>, + "comparison object must be invocable as const"); +# endif // C++17 +#endif // C++11 protected: typedef _Rb_tree_node_base* _Base_ptr; |