-
Notifications
You must be signed in to change notification settings - Fork 13.5k
libcxx: std::ostream::sentry should be exported #140169
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
Conversation
41904da
to
56b71d9
Compare
… template should be instantiated In-code comment says "explicit instantiation decl of the outer class doesn't affect the inner class" but this behavior seems MSVC specific, MinGW-GCC and Cygwin-GCC does not. Clang should honor gcc's behavior. This change fixes std::string compatibilty and resolves strange link error (statically linked), strange crash (dynamically linked) using libstdc++ on Cygwin.
56b71d9
to
73c338c
Compare
✅ With the latest revision this PR passed the C/C++ code formatter. |
FYI, note that even if you include clang changes here, those won't be used by the libcxx CI build; the CI uses a prebuilt build of llvm-mingw - see |
I know, I just started with #140145 for my testing, this pr is really meant for testing that no other platform is broken. https://github.com/jeremyd2019/llvm-mingw/actions/runs/15075388808 is running the full test of af82a52 and now https://github.com/jeremyd2019/llvm-mingw/actions/runs/15078849158 for 04ef889 (since at least i686 already failed due to istream which was not done as a test to make sure the issue was reproducing) |
233fc83
to
8ca8bdc
Compare
2dca920
to
ce1573e
Compare
ce1573e
to
5035da0
Compare
use test llvm-mingw toolchain
…bility with Mingw-GCC In MinGW environment, Clang handles dllexport attribute of internal class that defined in class template in different way from GCC. This incompatibility should be fixed but breaks ABI of libc++, so introduce a new keyword to keep ABI in MinGW environment with old and patched Clang and to stay ABI compatible on other platforms. This attribute is attached only for basic_ostream::sentry::sentry, basic_ostream::sentry::~sentry and basic_istream::sentry::sentry. Other entities won't be affected by patching Clang so doesn't need to be annotate. At a time to introduce a new class as a non-template inner type of a class template, all non-inline member functions of that class also needs to be attached _LIBCPP_HIDE_FROM_ABI_MINGW_OR_AFTER_V1 or _LIBCPP_HIDE_FROM_ABI, not _LIBCPP_HIDE_FROM_ABI_AFTER_V1. Otherwise, that member functions contained in DLL will be inaccessible on MinGW environment. For time to increase ABI version, _LIBCPP_HIDE_FROM_ABI_MINGW_OR_AFTER_V1 can be simply replaced to _LIBCPP_HIDE_FROM_ABI_AFTER_V1.
5035da0
to
54221fd
Compare
Since it seems so hard to get to stages 2 and 3
5d1e523
to
bffb58e
Compare
Not for review. Testing another idea for #140145