summaryrefslogtreecommitdiffstats
path: root/libcxx/include/vector
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-12-11 05:31:00 +0000
committerEric Fiselier <eric@efcs.ca>2016-12-11 05:31:00 +0000
commitc71bd55b5dd20dd94c5b87a30adb1da7e81c5114 (patch)
tree51ebcc46d3d70c5c3d18b752ab7e2910ff481f78 /libcxx/include/vector
parent72967a56e17c3ba7f1f689aaf569dd0648a1d3df (diff)
downloadbcm5719-llvm-c71bd55b5dd20dd94c5b87a30adb1da7e81c5114.tar.gz
bcm5719-llvm-c71bd55b5dd20dd94c5b87a30adb1da7e81c5114.zip
Enable the -Wsign-compare warning to better support MSVC
llvm-svn: 289363
Diffstat (limited to 'libcxx/include/vector')
-rw-r--r--libcxx/include/vector4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/include/vector b/libcxx/include/vector
index f5bd7d07245..f175e47be9a 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -3093,7 +3093,9 @@ typename enable_if
>::type
vector<bool, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
{
- difference_type __n = _VSTD::distance(__first, __last);
+ const difference_type __n_signed = _VSTD::distance(__first, __last);
+ _LIBCPP_ASSERT(__n_signed >= 0, "invalid range specified");
+ const size_type __n = static_cast<size_type>(__n_signed);
iterator __r;
size_type __c = capacity();
if (__n <= __c && size() <= __c - __n)
OpenPOWER on IntegriCloud