[libc++][test] nasty_char_traits::move
is incompatible with constexpr
#74221
Labels
nasty_char_traits::move
is incompatible with constexpr
#74221
Found while running libc++'s test suite with MSVC's STL.
nasty_char_traits::move
is markedconstexpr
but compares unrelated pointerss1 < s2
. This is forbidden, andnasty_char_traits::copy
acknowledges this immediately below:llvm-project/libcxx/test/support/nasty_string.h
Lines 120 to 141 in 38f75d6
Click to expand compiler error:
With libc++'s test suite, MSVC's STL, and Clang/LLVM,
std/strings/basic.string/string.modifiers/string_append/initializer_list.pass.cpp
emits this error:In microsoft/STL's product code, I have a truly marvelous way to avoid this problem - a linear scan to detect whether the first iterator of the destination is within the source range, in which case a backward loop is necessary. See https://github.com/microsoft/STL/blob/0403d19f5461fd15983737c3f01ec34800ea9275/stl/inc/xstring#L85-L93 .
The text was updated successfully, but these errors were encountered: