https://github.com/llvm/llvm-project/issues/40363 caused the C++20
str() const & and str() && to be dllimport'ed despite _LIBCPP_HIDE_FROM_ABI.
This is a temporary solution until #40363 is fixed.
Details
- Reviewers
hans ldionne Mordante - Group Reviewers
Restricted Project - Commits
- rG8ecb9591646d: [libc++] Work around dynamic linking of stringbuf::str() on Windows
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/sstream | ||
---|---|---|
359 | Moving this one seems unrelated? |
libcxx/include/sstream | ||
---|---|---|
359 | It is related. This overload does not conflict with the pre-C++20 one, so it shouldn't depend on _LIBCPP_BUILDING_LIBRARY. |
libcxx/include/sstream | ||
---|---|---|
359 | I mean it doesn't seem related to the problem we're working around with _LIBCPP_HIDE_FROM_ABI_SSTREAM, so perhaps it would be better to do it in a separate patch? |
libcxx/include/sstream | ||
---|---|---|
359 | It's the same problem: overload missing with _LIBCPP_BUILDING_LIBRARY, just a different solution. |
libcxx/include/sstream | ||
---|---|---|
359 | I think because it's a template, this one does not have the linking issues that the others do. I also don't feel strongly about this change, just want to make sure I understand it. |
libcxx/include/sstream | ||
---|---|---|
359 | Oh, you are right! |
I wasn't sure if you were planning to update the patch to not move the str(const _SAlloc& __sa) const template, but either way is fine by me really.
libcxx/include/sstream | ||
---|---|---|
232 | This is our typical pattern. | |
232 | Note this feels a bit of a hack, however since it's temporary I've no objection. | |
233 | Please add a this link in the commit message too. We've changed bug trackers before so having an explicit link makes it easier to find in the future. | |
341 | Why move this hunk? |
libcxx/include/sstream | ||
---|---|---|
232 | It was suggested by @ldionne in https://reviews.llvm.org/D153709 as a short-term solution. | |
341 | It was an error to have this overload conditional on _LIBCPP_BUILDING_LIBRARY in the first place. I put it here originally just to follow the order in the spec. |
libcxx/include/sstream | ||
---|---|---|
233 | Why don't I see the updated commit message here? I used arc diff. |
libcxx/include/sstream | ||
---|---|---|
233 | Nevermind, I found https://secure.phabricator.com/T2386 :) |
libcxx/include/sstream | ||
---|---|---|
233 | So clang>=17 doesn't have this bug anymore? I ask because https://github.com/llvm/llvm-project/issues/40363 is still open. |
libcxx/include/sstream | ||
---|---|---|
233 | The plan is to fix this bug before the clang 17 release. |
Thanks LGTM. I leave the final approval to @ldionne.
libcxx/include/sstream | ||
---|---|---|
232 | Not sure you can link to them, you can when clicking on the link in the generic overview. I found Louis' suggestion without a hypen. | |
233 |
Typically I just edit the commit message on Phab after I submitted a review. This will be applied to the patch when landing. | |
341 | Thanks for the information. |
LGTM. Note that this might be fixed by D155713 in Clang, but this patch is still needed in the meantime.
This is our typical pattern.