diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-03-11 20:30:06 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-03-11 20:30:06 +0000 |
commit | 163c8ab66f9ab2b4938f8bc23698eb336444b8fc (patch) | |
tree | ffecdc8300de20e3337aa723a622a3fa0ee03ea7 /contrib/libc++ | |
parent | bf081e99484afb4df9759d3613354e95586ab3cc (diff) | |
download | src-163c8ab66f9ab2b4938f8bc23698eb336444b8fc.tar.gz src-163c8ab66f9ab2b4938f8bc23698eb336444b8fc.zip |
Pull in r246280 from upstream libc++ trunk (by Eric Fiselier):
Fix most GCC warnings during build. Only -Wattribute left.
This helps to fix a number of -Werror warnings when building world with
recent versions of gcc (e.g. the devel/*-xtoolchain-gcc ports).
Notes
Notes:
svn path=/head/; revision=296679
Diffstat (limited to 'contrib/libc++')
-rw-r--r-- | contrib/libc++/include/string | 7 | ||||
-rw-r--r-- | contrib/libc++/include/system_error | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/contrib/libc++/include/string b/contrib/libc++/include/string index 5777ee2a547b..6e63ab18418f 100644 --- a/contrib/libc++/include/string +++ b/contrib/libc++/include/string @@ -1445,7 +1445,8 @@ public: _LIBCPP_INLINE_VISIBILITY size_type length() const _NOEXCEPT {return size();} _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY size_type capacity() const _NOEXCEPT - {return (__is_long() ? __get_long_cap() : __min_cap) - 1;} + {return (__is_long() ? __get_long_cap() + : static_cast<size_type>(__min_cap)) - 1;} void resize(size_type __n, value_type __c); _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());} @@ -1785,11 +1786,11 @@ private: template <size_type __a> static _LIBCPP_INLINE_VISIBILITY size_type __align_it(size_type __s) _NOEXCEPT - {return __s + (__a-1) & ~(__a-1);} + {return (__s + (__a-1)) & ~(__a-1);} enum {__alignment = 16}; static _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __s) _NOEXCEPT - {return (__s < __min_cap ? __min_cap : + {return (__s < __min_cap ? static_cast<size_type>(__min_cap) : __align_it<sizeof(value_type) < __alignment ? __alignment/sizeof(value_type) : 1 > (__s+1)) - 1;} diff --git a/contrib/libc++/include/system_error b/contrib/libc++/include/system_error index 66bf6d6c4249..134bb3274031 100644 --- a/contrib/libc++/include/system_error +++ b/contrib/libc++/include/system_error @@ -371,7 +371,7 @@ public: error_category() _NOEXCEPT; #else _LIBCPP_ALWAYS_INLINE - _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT _LIBCPP_DEFAULT; + _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT _LIBCPP_DEFAULT #endif private: error_category(const error_category&);// = delete; |