http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59529

            Bug ID: 59529
           Summary: fix experimental/string_view end-of-string edge cases
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bigotp at acm dot org

Created attachment 31448
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31448&action=edit
Patch and test update

Per http://isocpp.org/files/papers/N3762.html#string.view.ops, for a given
string_view sv:

   stringview sv{"text"};
   auto rv = sv.substr(sv.size());

rv should be a string view starting at sv.end() with size zero.  In the current
implementation this code improperly raises std::out_of_range.

Related to this, basic_string_view constructors with length zero and a valid
str should not be re-mapped to the internal empty string.

Reply via email to