diff options
author | dim <dim@FreeBSD.org> | 2015-10-09 21:04:28 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-10-09 21:04:28 +0000 |
commit | c8b9e1b4f19c160f314955218d6d9a442821ef43 (patch) | |
tree | fa0dd5bba88c51092f776b1aa06c75a91f7b97b1 /contrib/libc++/include/__hash_table | |
parent | fcb0c0cc8d6934f766070dc4dbb56bf42c4679db (diff) | |
download | FreeBSD-src-c8b9e1b4f19c160f314955218d6d9a442821ef43.zip FreeBSD-src-c8b9e1b4f19c160f314955218d6d9a442821ef43.tar.gz |
Pull in r242623 from upstream libc++ trunk (by Eric Fiselier):
Enable and fix warnings during the build.
Although CMake adds warning flags, they are ignored in the libc++ headers
because the headers '#pragma system header' themselves.
This patch disables the system header pragma when building libc++ and fixes
the warnings that arose.
The warnings fixed were:
1. <memory> - anonymous structs are a GNU extension
2. <functional> - anonymous structs are a GNU extension.
3. <__hash_table> - Embedded preprocessor directives have undefined behavior.
4. <string> - Definition is missing noexcept from declaration.
5. <__std_stream> - Unused variable.
This should fix building world (in particular libatf-c++) with -std=c++11.
Reported by: Oliver Hartmann <ohartman@zedat.fu-berlin.de>
Diffstat (limited to 'contrib/libc++/include/__hash_table')
-rw-r--r-- | contrib/libc++/include/__hash_table | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/libc++/include/__hash_table b/contrib/libc++/include/__hash_table index f3a2030..ec20e10 100644 --- a/contrib/libc++/include/__hash_table +++ b/contrib/libc++/include/__hash_table @@ -984,15 +984,17 @@ public: __equal_range_multi(const _Key& __k) const; void swap(__hash_table& __u) +#if _LIBCPP_STD_VER <= 11 _NOEXCEPT_( __is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value -#if _LIBCPP_STD_VER <= 11 && (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value || __is_nothrow_swappable<__pointer_allocator>::value) && (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__node_allocator>::value) -#endif ); +#else + _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value); +#endif _LIBCPP_INLINE_VISIBILITY size_type max_bucket_count() const _NOEXCEPT @@ -2351,15 +2353,17 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__equal_range_multi( template <class _Tp, class _Hash, class _Equal, class _Alloc> void __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u) +#if _LIBCPP_STD_VER <= 11 _NOEXCEPT_( __is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value -#if _LIBCPP_STD_VER <= 11 && (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value || __is_nothrow_swappable<__pointer_allocator>::value) && (!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable<__node_allocator>::value) -#endif ) +#else + _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value) +#endif { { __node_pointer_pointer __npp = __bucket_list_.release(); |