Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround clang bug with basic_string_view #185

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Flamefire
Copy link
Contributor

Clang < 15 has a bug in c++-20 mode where using the std::basic_string constructor taking a pointer and size leads to an undefined symbol M_construct when used with Unicode char types.

See llvm/llvm-project#55560

Avoid this by using the range constructor.

Note that when converting this string_view to a std string the bug is triggered again because in libstdc++ the basic_string ctor from std::basic_string_view delegates to the size-range ctor and is instantiated if the source type is convertible to std::basic_string_view.
This can be verified by commenting out the std::basic_string_view conversion operator in boost::core::basic_string_view

Using libc++ also works.

@Flamefire Flamefire force-pushed the patch-1 branch 2 times, most recently from be8a50f to 2f8b7e1 Compare January 4, 2025 12:01
Flamefire and others added 2 commits January 4, 2025 14:44
Clang < 15 has a bug in c++-20 mode where using the `std::basic_string` constructor taking a pointer and size leads to an undefined symbol `M_construct` when used with Unicode char types

Avoid this by using the range constructor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant