This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/68133] constexpr basic_string_view(const _CharT* __str)


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68133

Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> ---
The implementation matches the required semantics (see
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4529.html). Please
note that std::char_traits::length is not constexpr because it is specified
that way and this is a known library issue, see

http://cplusplus.github.io/LWG/lwg-active.html#2232

The reason why the discussed string view constructor is nonetheless declared as
constexpr is due to the fact that a user *could* instantiate it with a
user-defined char trait class (not necessarily a specialization of
std::char_traits) that *has* a constexpr length function.

Based on this argumentation this issue looks invalid to me.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]