[llvm-bugs] [Bug 36863] New: basic_string_view(const CharT*, size_type) constructor shouldn't comment out assert of nullptr and length checks

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 21 19:07:38 PDT 2018


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

            Bug ID: 36863
           Summary: basic_string_view(const CharT*, size_type) constructor
                    shouldn't comment out assert of nullptr and length
                    checks
           Product: libc++
           Version: 6.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: joeloser93 at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

It looks like this check fails on GCC 4.9 per Marshall's commit message. We
should revisit why and perhaps conditionally enable this assert.

```
    _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
    basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT
        : __data(__s), __size(__len)
    {
// #if _LIBCPP_STD_VER > 11
//         _LIBCPP_ASSERT(__len == 0 || __s != nullptr,
"string_view::string_view(_CharT *, size_t): received nullptr");
// #endif
    }
```

-- 
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/20180322/979f9b0f/attachment-0001.html>


More information about the llvm-bugs mailing list