diff --git a/change/react-native-windows-94cad441-d079-4e22-bfcc-f2beb900bad1.json b/change/react-native-windows-94cad441-d079-4e22-bfcc-f2beb900bad1.json new file mode 100644 index 00000000000..351eaad7f94 --- /dev/null +++ b/change/react-native-windows-94cad441-d079-4e22-bfcc-f2beb900bad1.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "std::aligned_storage is deprecated", + "packageName": "react-native-windows", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h b/vnext/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h index 4ee9614d2e6..2c13f2de70f 100644 --- a/vnext/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +++ b/vnext/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h @@ -283,7 +283,9 @@ struct JsiAbiRuntime : facebook::jsi::Runtime { ~ValueRef() noexcept; operator facebook::jsi::Value const &() const noexcept; - using StoreType = std::aligned_storage_t; + struct alignas(std::max_align_t) StoreType { + std::byte buffer[sizeof(DataPointerValue)]; + }; static void InitValueRef(JsiValueRef const &data, facebook::jsi::Value *value, StoreType *store) noexcept; private: @@ -307,7 +309,9 @@ struct JsiAbiRuntime : facebook::jsi::Runtime { ~PropNameIDRef() noexcept; operator facebook::jsi::PropNameID const &() const noexcept; - using StoreType = std::aligned_storage_t; + struct alignas(std::max_align_t) StoreType { + std::byte buffer[sizeof(DataPointerValue)]; + }; private: StoreType m_pointerStore{};