http://llvm.org/bugs/show_bug.cgi?id=21496

            Bug ID: 21496
           Summary: string_view::remove_prefix, remove_suffix should leave
                    n > size() UB
           Product: libc++
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

They have explicit narrow contract:

  Requires: n <= size()

, but the libc++ made them work same as n == size(), which creates portability
problems.  For reference, libstdc++'s remove_prefix is guarded by assertion,
remove_suffix is just `this->_M_len -= __n;` (which may worth to be guarded as
well, but that's their problem).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to