[PATCH] D15862: A possible direction for fixing https://llvm.org/bugs/show_bug.cgi?id=25973.
Marshall Clow via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 4 11:53:14 PST 2016
mclow.lists added inline comments.
================
Comment at: include/string:1211
@@ +1210,3 @@
+// noexcept(declval<_Iter>().operator++()) &&
+// noexcept(++(declval<_Iter>())) &&
+ noexcept(declval<_Iter>() == declval<_Iter>()) &&
----------------
This is not quite right yet. I need to check for assignment, and the two commented out lines attempt to check for increment.
However, the first one fails when the iterator type is a pointer, and the second just fails.
================
Comment at: include/string:1556
@@ -1537,3 +1555,3 @@
<
- __is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ __is_exactly_input_iterator<_InputIterator>::value
+ || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
----------------
Drive-by improvement. I got tired of all the `__is_input_iterator <_InputIterator>::value && !__is_forward_iterator<_InputIterator>::value`, so I added `__is_exactly_input_iterator`
================
Comment at: include/string:2522
@@ -2502,4 +2521,3 @@
{
- clear();
- for (; __first != __last; ++__first)
- push_back(*__first);
+ call_input();
+ basic_string temp(__first, __last);
----------------
This is just test scaffolding so that I can be sure that the correct overload is getting called.
Will be removed before checkin.
================
Comment at: include/string:2538
@@ -2517,2 +2537,3 @@
{
+ call_forward();
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
----------------
Same as #2522
http://reviews.llvm.org/D15862
More information about the cfe-commits
mailing list