-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[libc++] Only forward-declare ABI-functions in exception_ptr.h if they are meant to be used #84707
[libc++] Only forward-declare ABI-functions in exception_ptr.h if they are meant to be used #84707
Conversation
@llvm/pr-subscribers-libcxx Author: None (itrofimow) ChangesThis patch fixes the unconditional fodward-declarations of ABI-functions in exception_ptr.h, and makes it dependendent on the availability macro, as it should've been from the beginning.
Full diff: https://github.com/llvm/llvm-project/pull/84707.diff 1 Files Affected:
diff --git a/libcxx/include/__exception/exception_ptr.h b/libcxx/include/__exception/exception_ptr.h
index 53e2f718bc1b35..c9027de9238cdd 100644
--- a/libcxx/include/__exception/exception_ptr.h
+++ b/libcxx/include/__exception/exception_ptr.h
@@ -26,6 +26,8 @@
#ifndef _LIBCPP_ABI_MICROSOFT
+# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
+
namespace __cxxabiv1 {
extern "C" {
@@ -37,14 +39,16 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception(
void*,
std::type_info*,
void(
-# if defined(_WIN32)
+# if defined(_WIN32)
__thiscall
-# endif
+# endif
*)(void*)) throw();
}
} // namespace __cxxabiv1
+# endif
+
#endif
namespace std { // purposefully not using versioning namespace
|
This
I hope having a way to remove the conflicting forward-declaration would suffice, but if this continues to cause problem I'd be ok with the thing being reverted from libcxx, and I'd shamefully pretend it never happened. Could you @ldionne please have a look? |
8251e2b
to
9daa1b3
Compare
This patch fixes the unconditional fodward-declarations of ABI-functions in exception_ptr.h, and makes it dependent on the availability macro, as it should've been from the beginning. The declarations being unconditional break the build with libcxxrt before 045c52ce821388f4ae4d119fe4fb75f1eb547b85, now they are opt-out. * libcxx/include/__exception/exception_ptr.h Only forward-declare ABI-functions if they are meant to be used.
9daa1b3
to
7174c99
Compare
The build failed for
doesn't seem related to me. |
__thiscall | ||
# endif | ||
# endif | ||
*)(void*)) throw(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-existing, no change requested: Should we replace these throw()
's with _NOEXCEPT
? (perhaps in another PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do it in this PR, I can't see a way for a potential need to revert just throw() -> _NOEXCEPT
.
Should I?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the patch as-is just to separate concerns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM. The CI failure in simd is not your patch.
__thiscall | ||
# endif | ||
# endif | ||
*)(void*)) throw(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the patch as-is just to separate concerns.
This patch fixes the unconditional forward-declarations of ABI-functions in exception_ptr.h, and makes it dependent on the availability macro, as it should've been from the beginning.
The declarations being unconditional break the build with libcxxrt before 045c52ce821388f4ae4d119fe4fb75f1eb547b85, now they are opt-out.
Only forward-declare ABI-functions if they are meant to be used.