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

Delete c++ launder #13

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ common-patch:
&& patch -p1 < $(PATCH_DIR)/nacl_armv6_2.patch \
&& patch -p2 < $(PATCH_DIR)/macos_h264_encoder.patch \
&& patch -p2 < $(PATCH_DIR)/disable_use_hermetic_xcode_on_linux.patch \
&& patch -p2 < $(PATCH_DIR)/linux_fix_launder.patch \
&& patch -p2 < $(PATCH_DIR)/add_licenses.patch

.PHONY: common-package
Expand Down
24 changes: 24 additions & 0 deletions patch/linux_fix_launder.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/src/third_party/abseil-cpp/absl/functional/internal/any_invocable.h b/src/third_party/abseil-cpp/absl/functional/internal/any_invocable.h
index f353139..0e046b7 100644
--- a/src/third_party/abseil-cpp/absl/functional/internal/any_invocable.h
+++ b/src/third_party/abseil-cpp/absl/functional/internal/any_invocable.h
@@ -195,11 +195,7 @@ union TypeErasedState {
template <class T>
T& ObjectInLocalStorage(TypeErasedState* const state) {
// We launder here because the storage may be reused with the same type.
-#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L
- return *std::launder(reinterpret_cast<T*>(&state->storage));
-#elif ABSL_HAVE_BUILTIN(__builtin_launder)
return *__builtin_launder(reinterpret_cast<T*>(&state->storage));
-#else

// When `std::launder` or equivalent are not available, we rely on undefined
// behavior, which works as intended on Abseil's officially supported
@@ -213,7 +209,6 @@ T& ObjectInLocalStorage(TypeErasedState* const state) {
#pragma GCC diagnostic pop
#endif

-#endif
}

// The type for functions issuing lifetime-related operations: move and dispose