From 44af4a2a3080f279224894756f4e461c9b20ad58 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 15 Sep 2023 14:35:20 -0700 Subject: [PATCH] Allow `` to compile for 80-bit long double. --- stl/inc/xlocnum | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stl/inc/xlocnum b/stl/inc/xlocnum index 86c19b22c9..30e53bdcbc 100644 --- a/stl/inc/xlocnum +++ b/stl/inc/xlocnum @@ -614,7 +614,9 @@ protected: virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base& _Iosbase, ios_base::iostate& _State, long double& _Val) const { // get long double from [_First, _Last) into _Val - static_assert(sizeof(double) == sizeof(long double), "Bad assumption: sizeof(double) == sizeof(long double)."); + // Assumes sizeof(double) == sizeof(long double). + // For 80-bit long double (which is not supported by MSVC in general), this will compile + // but will not attempt to handle the increased precision at runtime. double _Result; _First = num_get::do_get(_First, _Last, _Iosbase, _State, _Result); // avoid virtual call for perf _Val = _Result;