[libcxx-commits] [PATCH] D121231: [libc++] Remove raw call to debug handler from __char_traits_length_checked
Eric Fiselier via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 10 06:43:47 PST 2022
EricWF added a comment.
We would very much be open to upstreaming a version of change in order to reduce the burden to both the project and Google. We are working diligently at the moment to remove the patch internally entirely. It's the primary focus of my work at the moment. So anything we upstream would be temporary on the order of 6 months to a year. Let me know what you think is appropriate here.
Otherwise, this changed looks fine to us. If you wouldn't mind giving me until this afternoon so I can negotiate landing the required changes at Google. The changes are simple but require some finesse to ensure they land at the right time
================
Comment at: libcxx/include/string_view:244
+ // This needs to be a single statement for C++11 constexpr
+ return _LIBCPP_ASSERT(__s != nullptr, "null pointer passed to non-null argument of char_traits<...>::length"), _Traits::length(__s);
+}
----------------
If you use the ternary operator, you can make it a single statement without having to worry about custom char types that hijack ADL for operator,
Which is why it was written out that way initially.
Non built-in character types are allowed in string view, right?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121231/new/
https://reviews.llvm.org/D121231
More information about the libcxx-commits
mailing list