LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 36863 - basic_string_view(const CharT*, size_type) constructor shouldn't comment out assert of nullptr and length checks
Summary: basic_string_view(const CharT*, size_type) constructor shouldn't comment out ...
Status: RESOLVED FIXED
Alias: None
Product: libc++
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: 6.0
Hardware: All All
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-21 19:07 PDT by Joe Loser
Modified: 2019-06-03 22:22 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Loser 2018-03-21 19:07:38 PDT
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
    }
```
Comment 1 Marshall Clow (home) 2019-06-03 22:22:41 PDT
Re-enabled in revision 362465. (Now that we no longer support gcc 4.9)