Skip to content

Conversation

@philnik777
Copy link
Contributor

We don't support any platforms anymore where the __libcpp_refstring has to be ABI compatible with libstdc++'s C++03 implementation of string, so we can significantly simplify the implementation.

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions ,h -- libcxx/include/stdexcept libcxx/src/include/refstring.h --diff_from_common_commit

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/libcxx/src/include/refstring.h b/libcxx/src/include/refstring.h
index 3c7c5cc5b..acc11b25e 100644
--- a/libcxx/src/include/refstring.h
+++ b/libcxx/src/include/refstring.h
@@ -27,7 +27,7 @@ struct __libcpp_refstring::__rep {
 inline __libcpp_refstring::__libcpp_refstring(const char* msg) {
   std::size_t len = strlen(msg);
   auto* rep       = static_cast<__rep*>(::operator new(sizeof(__rep) + len + 1));
-  rep->refcount      = 0;
+  rep->refcount   = 0;
   std::memcpy(rep->data, msg, len + 1);
   __imp_ = rep;
 }

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On macOS, we don't support building new code against libstdc++ anymore. However, for backwards compatibility with apps that have already been built a long time ago, we do provide libstdc++.dylib in the dyld shared cache.

I aslo did a search and I did find some applications available for download on the App Store which reference some symbols from libstdc++. Hence, I think we need to keep this old code, sadly 🙁

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.

2 participants