summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-12-23 23:37:52 +0000
committerEric Fiselier <eric@efcs.ca>2016-12-23 23:37:52 +0000
commitfd838227411f3ce1fa348f1d334266231bbcc84d (patch)
tree204de9a3dad8b79d83bba224d8f6d4775169483f /libcxx/include
parent16166a4d71fca27f454a0837465143700dd41e98 (diff)
downloadbcm5719-llvm-fd838227411f3ce1fa348f1d334266231bbcc84d.tar.gz
bcm5719-llvm-fd838227411f3ce1fa348f1d334266231bbcc84d.zip
Fix unused parameters and variables
llvm-svn: 290459
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/__tree4
-rw-r--r--libcxx/include/algorithm7
-rw-r--r--libcxx/include/complex2
-rw-r--r--libcxx/include/exception7
-rw-r--r--libcxx/include/experimental/filesystem8
-rw-r--r--libcxx/include/experimental/optional4
-rw-r--r--libcxx/include/forward_list6
-rw-r--r--libcxx/include/iterator4
-rw-r--r--libcxx/include/list8
-rw-r--r--libcxx/include/locale3
-rw-r--r--libcxx/include/memory14
-rw-r--r--libcxx/include/optional4
-rw-r--r--libcxx/include/set2
-rw-r--r--libcxx/include/stdexcept24
-rw-r--r--libcxx/include/string2
-rw-r--r--libcxx/include/unordered_map20
-rw-r--r--libcxx/include/vector37
17 files changed, 103 insertions, 53 deletions
diff --git a/libcxx/include/__tree b/libcxx/include/__tree
index 4c94fe5a376..485a6c13af4 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -1428,7 +1428,7 @@ private:
__node_alloc() = __t.__node_alloc();
}
_LIBCPP_INLINE_VISIBILITY
- void __copy_assign_alloc(const __tree& __t, false_type) {}
+ void __copy_assign_alloc(const __tree&, false_type) {}
void __move_assign(__tree& __t, false_type);
void __move_assign(__tree& __t, true_type)
@@ -1448,7 +1448,7 @@ private:
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
{__node_alloc() = _VSTD::move(__t.__node_alloc());}
_LIBCPP_INLINE_VISIBILITY
- void __move_assign_alloc(__tree& __t, false_type) _NOEXCEPT {}
+ void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}
__node_pointer __detach();
static __node_pointer __detach(__node_pointer);
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 89e138b18c2..c4bf5991b63 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -1754,7 +1754,9 @@ _BidirectionalIterator2
copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
_BidirectionalIterator2 __result)
{
- return _VSTD::__copy_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
+ return _VSTD::__copy_backward(__unwrap_iter(__first),
+ __unwrap_iter(__last),
+ __unwrap_iter(__result));
}
// copy_if
@@ -4895,7 +4897,8 @@ push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
template <class _Compare, class _RandomAccessIterator>
void
-__sift_down(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+__sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
+ _Compare __comp,
typename iterator_traits<_RandomAccessIterator>::difference_type __len,
_RandomAccessIterator __start)
{
diff --git a/libcxx/include/complex b/libcxx/include/complex
index 4d122e9373a..22f568f555e 100644
--- a/libcxx/include/complex
+++ b/libcxx/include/complex
@@ -844,7 +844,7 @@ imag(const complex<_Tp>& __c)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename __libcpp_complex_overload_traits<_Tp>::_ValueType
-imag(_Tp __re)
+imag(_Tp)
{
return 0;
}
diff --git a/libcxx/include/exception b/libcxx/include/exception
index d8b8cce0254..98e1f37f919 100644
--- a/libcxx/include/exception
+++ b/libcxx/include/exception
@@ -163,6 +163,7 @@ make_exception_ptr(_Ep __e) _NOEXCEPT
return current_exception();
}
#else
+ ((void)__e);
_VSTD::abort();
#endif
}
@@ -208,6 +209,9 @@ throw_with_nested (_Tp& __t, typename enable_if<
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw __nested<typename remove_reference<_Tp>::type>(_VSTD::forward<_Tp>(__t));
+#else
+ ((void)__t);
+ // FIXME: Make this abort.
#endif
}
@@ -228,6 +232,9 @@ throw_with_nested (_Tp& __t, typename enable_if<
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw _VSTD::forward<_Tp>(__t);
+#else
+ ((void)__t);
+ // FIXME: Make this abort
#endif
}
diff --git a/libcxx/include/experimental/filesystem b/libcxx/include/experimental/filesystem
index 410235f11a3..739918bb2cb 100644
--- a/libcxx/include/experimental/filesystem
+++ b/libcxx/include/experimental/filesystem
@@ -1218,14 +1218,18 @@ private:
template <class... _Args>
_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+#ifndef _LIBCPP_NO_EXCEPTIONS
void __throw_filesystem_error(_Args && ...__args)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
throw filesystem_error(std::forward<_Args>(__args)...);
+}
#else
+void __throw_filesystem_error(_Args&&...)
+{
_VSTD::abort();
-#endif
}
+#endif
+
// operational functions
diff --git a/libcxx/include/experimental/optional b/libcxx/include/experimental/optional
index 57c5335f637..8dcda652319 100644
--- a/libcxx/include/experimental/optional
+++ b/libcxx/include/experimental/optional
@@ -721,7 +721,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
constexpr
bool
-operator<=(nullopt_t, const optional<_Tp>& __x) noexcept
+operator<=(nullopt_t, const optional<_Tp>&) noexcept
{
return true;
}
@@ -739,7 +739,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
constexpr
bool
-operator>(nullopt_t, const optional<_Tp>& __x) noexcept
+operator>(nullopt_t, const optional<_Tp>&) noexcept
{
return false;
}
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index a75d6e978d9..d70f7eddef6 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -531,7 +531,7 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- void __move_assign_alloc(__forward_list_base& __x, false_type) _NOEXCEPT
+ void __move_assign_alloc(__forward_list_base&, false_type) _NOEXCEPT
{}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(__forward_list_base& __x, true_type)
@@ -1426,7 +1426,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
- forward_list& __x,
+ forward_list& /*__other*/,
const_iterator __i)
{
const_iterator __lm1 = _VSTD::next(__i);
@@ -1441,7 +1441,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
- forward_list& __x,
+ forward_list& /*__other*/,
const_iterator __f, const_iterator __l)
{
if (__f != __l && __p != __f)
diff --git a/libcxx/include/iterator b/libcxx/include/iterator
index 657236d9347..2a859c54df9 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -1751,13 +1751,13 @@ template <class _Cont>
constexpr auto size(const _Cont& __c) -> decltype(__c.size()) { return __c.size(); }
template <class _Tp, size_t _Sz>
-constexpr size_t size(const _Tp (&__array)[_Sz]) noexcept { return _Sz; }
+constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; }
template <class _Cont>
constexpr auto empty(const _Cont& __c) -> decltype(__c.empty()) { return __c.empty(); }
template <class _Tp, size_t _Sz>
-constexpr bool empty(const _Tp (&__array)[_Sz]) noexcept { return false; }
+constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; }
template <class _Ep>
constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }
diff --git a/libcxx/include/list b/libcxx/include/list
index e44bcf26a42..220a40205c4 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -655,7 +655,7 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- void __copy_assign_alloc(const __list_imp& __c, false_type)
+ void __copy_assign_alloc(const __list_imp&, false_type)
{}
_LIBCPP_INLINE_VISIBILITY
@@ -666,7 +666,7 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- void __move_assign_alloc(__list_imp& __c, false_type)
+ void __move_assign_alloc(__list_imp&, false_type)
_NOEXCEPT
{}
};
@@ -2336,14 +2336,14 @@ list<_Tp, _Alloc>::__decrementable(const const_iterator* __i) const
template <class _Tp, class _Alloc>
bool
-list<_Tp, _Alloc>::__addable(const const_iterator* __i, ptrdiff_t __n) const
+list<_Tp, _Alloc>::__addable(const const_iterator*, ptrdiff_t) const
{
return false;
}
template <class _Tp, class _Alloc>
bool
-list<_Tp, _Alloc>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const
+list<_Tp, _Alloc>::__subscriptable(const const_iterator*, ptrdiff_t) const
{
return false;
}
diff --git a/libcxx/include/locale b/libcxx/include/locale
index adb03af94e7..2bda44d6bcd 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -3932,7 +3932,8 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()
streamsize __nmemb = _VSTD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
static_cast<streamsize>(__extbufend_ - __extbufnext_));
codecvt_base::result __r;
- state_type __svs = __st_;
+ // FIXME: Do we ever need to restore the state here?
+ //state_type __svs = __st_;
streamsize __nr = __bufptr_->sgetn(const_cast<char*>(__extbufnext_), __nmemb);
if (__nr != 0)
{
diff --git a/libcxx/include/memory b/libcxx/include/memory
index 8a3237f3238..b4c2b35c0b7 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -1605,7 +1605,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
is_trivially_move_constructible<_Tp>::value,
void
>::type
- __construct_forward(allocator_type& __a, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
+ __construct_forward(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
{
ptrdiff_t _Np = __end1 - __begin1;
if (_Np > 0)
@@ -1635,7 +1635,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
is_trivially_move_constructible<_Tp>::value,
void
>::type
- __construct_range_forward(allocator_type& __a, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
+ __construct_range_forward(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
{
typedef typename remove_const<_Tp>::type _Vp;
ptrdiff_t _Np = __end1 - __begin1;
@@ -1669,7 +1669,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
is_trivially_move_constructible<_Tp>::value,
void
>::type
- __construct_backward(allocator_type& __a, _Tp* __begin1, _Tp* __end1, _Tp*& __end2)
+ __construct_backward(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __end2)
{
ptrdiff_t _Np = __end1 - __begin1;
__end2 -= _Np;
@@ -2109,7 +2109,7 @@ public:
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
+ __libcpp_compressed_pair_imp(piecewise_construct_t,
tuple<_Args1...> __first_args,
tuple<_Args2...> __second_args,
__tuple_indices<_I1...>,
@@ -2164,7 +2164,7 @@ public:
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
+ __libcpp_compressed_pair_imp(piecewise_construct_t,
tuple<_Args1...> __first_args,
tuple<_Args2...> __second_args,
__tuple_indices<_I1...>,
@@ -2220,7 +2220,7 @@ public:
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
+ __libcpp_compressed_pair_imp(piecewise_construct_t,
tuple<_Args1...> __first_args,
tuple<_Args2...> __second_args,
__tuple_indices<_I1...>,
@@ -2274,7 +2274,7 @@ public:
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
+ __libcpp_compressed_pair_imp(piecewise_construct_t,
tuple<_Args1...> __first_args,
tuple<_Args2...> __second_args,
__tuple_indices<_I1...>,
diff --git a/libcxx/include/optional b/libcxx/include/optional
index c64aa8f7f72..735ef479e02 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -1080,7 +1080,7 @@ operator<=(const optional<_Tp>& __x, nullopt_t) noexcept
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
bool
-operator<=(nullopt_t, const optional<_Tp>& __x) noexcept
+operator<=(nullopt_t, const optional<_Tp>&) noexcept
{
return true;
}
@@ -1096,7 +1096,7 @@ operator>(const optional<_Tp>& __x, nullopt_t) noexcept
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY constexpr
bool
-operator>(nullopt_t, const optional<_Tp>& __x) noexcept
+operator>(nullopt_t, const optional<_Tp>&) noexcept
{
return false;
}
diff --git a/libcxx/include/set b/libcxx/include/set
index 606af726abf..8e4c2ae6a60 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -1023,7 +1023,7 @@ public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, value_type&& __v)
- {return __tree_.__insert_multi(_VSTD::move(__v));}
+ {return __tree_.__insert_multi(__p, _VSTD::move(__v));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept
index b9dd2853f28..d501d091608 100644
--- a/libcxx/include/stdexcept
+++ b/libcxx/include/stdexcept
@@ -191,7 +191,8 @@ void __throw_logic_error(const char*__msg)
#ifndef _LIBCPP_NO_EXCEPTIONS
throw logic_error(__msg);
#else
- _VSTD::abort();
+ ((void)__msg);
+ _VSTD::abort();
#endif
}
@@ -201,7 +202,8 @@ void __throw_domain_error(const char*__msg)
#ifndef _LIBCPP_NO_EXCEPTIONS
throw domain_error(__msg);
#else
- _VSTD::abort();
+ ((void)__msg);
+ _VSTD::abort();
#endif
}
@@ -211,7 +213,8 @@ void __throw_invalid_argument(const char*__msg)
#ifndef _LIBCPP_NO_EXCEPTIONS
throw invalid_argument(__msg);
#else
- _VSTD::abort();
+ ((void)__msg);
+ _VSTD::abort();
#endif
}
@@ -221,7 +224,8 @@ void __throw_length_error(const char*__msg)
#ifndef _LIBCPP_NO_EXCEPTIONS
throw length_error(__msg);
#else
- _VSTD::abort();
+ ((void)__msg);
+ _VSTD::abort();
#endif
}
@@ -231,7 +235,8 @@ void __throw_out_of_range(const char*__msg)
#ifndef _LIBCPP_NO_EXCEPTIONS
throw out_of_range(__msg);
#else
- _VSTD::abort();
+ ((void)__msg);
+ _VSTD::abort();
#endif
}
@@ -241,7 +246,8 @@ void __throw_range_error(const char*__msg)
#ifndef _LIBCPP_NO_EXCEPTIONS
throw range_error(__msg);
#else
- _VSTD::abort();
+ ((void)__msg);
+ _VSTD::abort();
#endif
}
@@ -251,7 +257,8 @@ void __throw_overflow_error(const char*__msg)
#ifndef _LIBCPP_NO_EXCEPTIONS
throw overflow_error(__msg);
#else
- _VSTD::abort();
+ ((void)__msg);
+ _VSTD::abort();
#endif
}
@@ -261,7 +268,8 @@ void __throw_underflow_error(const char*__msg)
#ifndef _LIBCPP_NO_EXCEPTIONS
throw underflow_error(__msg);
#else
- _VSTD::abort();
+ ((void)__msg);
+ _VSTD::abort();
#endif
}
diff --git a/libcxx/include/string b/libcxx/include/string
index 840fd0098ca..2e5ffc1b6d0 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -2220,7 +2220,7 @@ bool __ptr_in_range (const _Tp* __p, const _Tp* __first, const _Tp* __last)
}
template <class _Tp1, class _Tp2>
-bool __ptr_in_range (const _Tp1* __p, const _Tp2* __first, const _Tp2* __last)
+bool __ptr_in_range (const _Tp1*, const _Tp2*, const _Tp2*)
{
return false;
}
diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index 55469894955..50be81e461f 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -922,6 +922,8 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__p);
#endif
return insert(__x).first;
}
@@ -946,6 +948,8 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__p);
#endif
return __table_.__insert_unique(_VSTD::move(__x)).first;
}
@@ -965,6 +969,8 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::insert(const_iterator, value_type&&) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__p);
#endif
return insert(_VSTD::forward<_Pp>(__x)).first;
}
@@ -982,6 +988,8 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::emplace_hint(const_iterator, args...) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__p);
#endif
return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;
}
@@ -1015,8 +1023,10 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
"unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__h);
#endif
- return try_emplace(__k, _VSTD::forward<_Args>(__args)...).first;
+ return try_emplace(__k, _VSTD::forward<_Args>(__args)...).first;
}
template <class... _Args>
@@ -1027,6 +1037,8 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
"unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__h);
#endif
return try_emplace(_VSTD::move(__k), _VSTD::forward<_Args>(__args)...).first;
}
@@ -1057,15 +1069,17 @@ public:
template <class _Vp>
_LIBCPP_INLINE_VISIBILITY
- iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v)
+ iterator insert_or_assign(const_iterator, const key_type& __k, _Vp&& __v)
{
+ // FIXME: Add debug mode checking for the iterator input
return insert_or_assign(__k, _VSTD::forward<_Vp>(__v)).first;
}
template <class _Vp>
_LIBCPP_INLINE_VISIBILITY
- iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v)
+ iterator insert_or_assign(const_iterator, key_type&& __k, _Vp&& __v)
{
+ // FIXME: Add debug mode checking for the iterator input
return insert_or_assign(_VSTD::move(__k), _VSTD::forward<_Vp>(__v)).first;
}
#endif
diff --git a/libcxx/include/vector b/libcxx/include/vector
index f175e47be9a..3dae3b5df53 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -821,30 +821,40 @@ private:
// We call annotatations only for the default Allocator because other allocators
// may not meet the AddressSanitizer alignment constraints.
// See the documentation for __sanitizer_annotate_contiguous_container for more details.
- void __annotate_contiguous_container
- (const void *__beg, const void *__end, const void *__old_mid, const void *__new_mid) const
- {
#ifndef _LIBCPP_HAS_NO_ASAN
+ void __annotate_contiguous_container(const void *__beg, const void *__end,
+ const void *__old_mid,
+ const void *__new_mid) const
+ {
+
if (__beg && is_same<allocator_type, __default_allocator_type>::value)
__sanitizer_annotate_contiguous_container(__beg, __end, __old_mid, __new_mid);
-#endif
}
-
- void __annotate_new(size_type __current_size) const
- {
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ void __annotate_contiguous_container(const void*, const void*, const void*,
+ const void*) const {}
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ void __annotate_new(size_type __current_size) const {
__annotate_contiguous_container(data(), data() + capacity(),
data() + capacity(), data() + __current_size);
}
- void __annotate_delete() const
- {
+
+ _LIBCPP_INLINE_VISIBILITY
+ void __annotate_delete() const {
__annotate_contiguous_container(data(), data() + capacity(),
data() + size(), data() + capacity());
}
+
+ _LIBCPP_INLINE_VISIBILITY
void __annotate_increase(size_type __n) const
{
__annotate_contiguous_container(data(), data() + capacity(),
data() + size(), data() + size() + __n);
}
+
+ _LIBCPP_INLINE_VISIBILITY
void __annotate_shrink(size_type __old_size) const
{
__annotate_contiguous_container(data(), data() + capacity(),
@@ -869,8 +879,9 @@ private:
};
#else
struct __RAII_IncreaseAnnotator {
- inline __RAII_IncreaseAnnotator(const vector &, size_type __n = 1) {}
- inline void __done() {}
+ _LIBCPP_INLINE_VISIBILITY
+ __RAII_IncreaseAnnotator(const vector &, size_type = 1) {}
+ _LIBCPP_INLINE_VISIBILITY void __done() {}
};
#endif
@@ -2914,7 +2925,9 @@ typename enable_if
vector<bool, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
{
clear();
- difference_type __n = _VSTD::distance(__first, __last);
+ difference_type __ns = _VSTD::distance(__first, __last);
+ _LIBCPP_ASSERT(__ns >= 0, "invalid range specified");
+ const size_t __n = static_cast<size_type>(__ns);
if (__n)
{
if (__n > capacity())
OpenPOWER on IntegriCloud