[llvm-bugs] [Bug 44724] New: [span] Incorrect return type of span<T, dynamic_extent>::subspan

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 31 01:10:01 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=44724

            Bug ID: 44724
           Summary: [span] Incorrect return type of span<T,
                    dynamic_extent>::subspan
           Product: libc++
           Version: 10.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mschellenbergercosta at googlemail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

According to the standard (https://eel.is/c++draft/views.span#span.sub-10) the
return type of ```std::span<T>::subspan<T, Count>``` should be ``` span<T,
Count> ```.

However, it is currently ```span<T, dynamic_extent>```

Consequently, calling ```std::span<T>::subspan<T, 4>``` would return
``std::span<T>``` rather than the intended ```std::span<T, 4>```.

There is already a PR open for that (https://reviews.llvm.org/D71997). Maybe
this raises awareness.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200131/22d0374c/attachment-0001.html>


More information about the llvm-bugs mailing list