[libcxx-commits] [PATCH] D96385: [libc++] [P1032] Finish constexpr-ifying <iterator>, <string_view>, <tuple>, <utility>.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 14 14:26:00 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp:87
+    assert(std::basic_string_view<CharT>(buf) == bcdjk);
+    return true;
 }
----------------
I've figured out that line 85 fails on GCC because libc++'s `char_traits<char>::length` calls `__builtin_strlen`, which is not a constant expression on GCC yet. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816

GNU libstdc++ works around this GCC bug by saying "okay, past C++17 we won't use `__builtin_strlen` anymore." See
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/bits/char_traits.h#L364-L372

Should libc++ copy their cop-out (conditional on `!defined(__clang__)`)? Or should I just mark this test as `UNSUPPORTED: gcc-10` and move on? For now I'll upload a diff marked UNSUPPORTED just to prove that that'll make buildkite happy enough to land this if that's the route we want to take.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96385/new/

https://reviews.llvm.org/D96385



More information about the libcxx-commits mailing list