[libcxx-commits] [libcxx] [libcxx][NFC] Suppress -Wmicrosoft-cast in MSVC's exception_ptr (PR #210570)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jul 18 22:18:55 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Petr Hosek (petrhosek)

<details>
<summary>Changes</summary>

This was introduced as part of #<!-- -->94977.

---
Full diff: https://github.com/llvm/llvm-project/pull/210570.diff


1 Files Affected:

- (modified) libcxx/src/support/runtime/exception_pointer_msvc.ipp (+3-2) 


``````````diff
diff --git a/libcxx/src/support/runtime/exception_pointer_msvc.ipp b/libcxx/src/support/runtime/exception_pointer_msvc.ipp
index 3102d1ee93db2..4b877deeec7bc 100644
--- a/libcxx/src/support/runtime/exception_pointer_msvc.ipp
+++ b/libcxx/src/support/runtime/exception_pointer_msvc.ipp
@@ -141,7 +141,7 @@ void __copy_exception_object(void* __dest, const void* __src, const CatchableTyp
 #if _EH_RELATIVE_TYPEINFO
   const auto __copy_func = reinterpret_cast<void*>(__throw_image_base + __type->copyFunction);
 #else // _EH_RELATIVE_TYPEINFO
-  const auto __copy_func = __type->copyFunction;
+  const auto __copy_func = reinterpret_cast<void*>(__type->copyFunction);
 #endif // _EH_RELATIVE_TYPEINFO
 
   const auto __adjusted = __AdjustPointer(const_cast<void*>(__src), __type->thisDisplacement);
@@ -204,7 +204,8 @@ struct alignas(__STDCPP_DEFAULT_NEW_ALIGNMENT__) __exception_ptr_normal final :
           __call_member_function_0(__cpp_eh_record.params.pExceptionObject,
                                    reinterpret_cast<void*>(__throw_info->pmfnUnwind + __throw_image_base));
 #else // _EH_RELATIVE_TYPEINFO
-          __call_member_function_0(__cpp_eh_record.params.pExceptionObject, __throw_info->pmfnUnwind);
+          __call_member_function_0(__cpp_eh_record.params.pExceptionObject,
+                                   reinterpret_cast<void*>(__throw_info->pmfnUnwind));
 #endif // _EH_RELATIVE_TYPEINFO
         } else if (__type->properties & CT_IsWinRTHandle) {
           const auto* __unknown = *static_cast<IUnknown* const*>(__cpp_eh_record.params.pExceptionObject);

``````````

</details>


https://github.com/llvm/llvm-project/pull/210570


More information about the libcxx-commits mailing list