core icon indicating copy to clipboard operation
core copied to clipboard

Add reproducer for Clang < 15 bug with string_view & C++11 char types

Open Flamefire opened this issue 11 months ago • 2 comments

This is the test case for #185 to reproduce the issue such that it can be verified that it works. Made as a separate PR so CI runs and the state for the commit gets shown.

As explained in #185 converting this string_view to a std string the bug is triggered too but cannot be fixed without removing the conversion to std::basic_string_view. Hence the condition to exclude it in Clang < 15

Flamefire avatar Jan 04 '25 11:01 Flamefire

I see no CI failures for Clang 13/14 here.

pdimov avatar Jan 04 '25 15:01 pdimov

Seems using libstdc++ 12 and up requires Clang 15. Using libstdc++ 11 works also locally.

I'd say the test still makes sense to find potential regressions with the unicode char types.
And the workaround in #185 doesn't make anything worse: end() == data() + size() which the std::basic_string ctor does too if data(), size() is passed. But it helps in one (even if now less relevant) case:

Flamefire avatar Jan 04 '25 16:01 Flamefire