Skip to content

basic_string_view(const CharT*, size_type) constructor shouldn't comment out assert of nullptr and length checks #36211

@JoeLoser

Description

@JoeLoser
Bugzilla Link 36863
Resolution FIXED
Resolved on Jun 03, 2019 22:22
Version 6.0
OS All
CC @mclow

Extended Description

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
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions