[libcxx-commits] [libcxx] [libc++][strings] P2591R5: Concatenation of strings and string views (PR #88389)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Apr 15 09:12:45 PDT 2024
mordante wrote:
> @mordante @frederick-vs-ja Thank you for the feedback. I have encountered two issues.
>
> * Adding another step of indirection to the tests causes _constexpr evaluation hit maximum step limit; possible infinite loop_. I haven't seen this before, so I refactored the tests to use one less step:
>
>
> ```
> Projects/llvm-project/build/default.debug.libcxx/include/c++/v1/__memory/compressed_pair.h:142:5: note: constexpr evaluation hit maximum step limit; possible infinite loop?
> # | 142 | return static_cast<_Base2 const&>(*this).__get();
> ```
>
> * The second issue is that if I use the paper wording in the code base for the implementation is that I get a compiler error with `constexpr_char_traits` when I concatenate `StringView + String`, so I used the @hawkinsw implementation (Thanks!) more of a workaround rather than optimization in the current iteration (I mean I haven't done any benchmarks yet):
>
>
> ```
> constexpr_char_traits.h:105:12: note: comparison between '&__r.__r_.__compressed_pair_elem::__value_.__compressed_pair_elem::union (anonymous union at /include/c++/v1/string:867:5).__compressed_pair_elem::__s.__compressed_pair_elem::__data_[0]' and '&"short"[0]' has unspecified value
> # | 105 | if (s1 < s2)
> # | | ^
> ```
>
> (this feels like a bug) which is even odder I am not able to reproduce the same behavior on [compiler explorer ](https://godbolt.org/z/G86c3E4cj)
Can you create a new branch in your repository with these issues and post the branch name here? Then I want to take a look at both issues. There is a work-around for the step limit; but based on how simple the tests are I wonder whether it's not infinite recursion.
https://github.com/llvm/llvm-project/pull/88389
More information about the libcxx-commits
mailing list