We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53b18b0 commit 062f327Copy full SHA for 062f327
crates/intrinsic-test/src/x86/config.rs
@@ -324,7 +324,7 @@ pub const PLATFORM_C_FORWARD_DECLARATIONS: &str = r#"
324
template<typename T1, typename T2> T1 cast(T2 x) {
325
if constexpr ((std::is_integral_v<T1> && std::is_integral_v<T2>) || (std::is_floating_point_v<T1> && std::is_floating_point_v<T2>)) {
326
return x;
327
- } else if constexpr (sizeof(T1) == sizeof(T2)) {
+ } else if constexpr (sizeof(T1) <= sizeof(T2)) {
328
T1 ret{};
329
std::memcpy(&ret, &x, sizeof(T1));
330
return ret;
0 commit comments