@@ -944,8 +944,12 @@ constexpr uint16_t
944944template <>
945945inline constexpr std::float16_t
946946binary_format<std::float16_t >::exact_power_of_ten(am_pow_t power) {
947+ #if defined(__clang__)
947948 // Work around clang bug https://godbolt.org/z/zedh7rrhc
948- return (void )powers_of_ten[0 ], powers_of_ten[power];
949+ return (void )max_mantissa[0 ], max_mantissa[power];
950+ #else
951+ return max_mantissa[power];
952+ #endif
949953}
950954
951955template <>
@@ -989,9 +993,12 @@ inline constexpr am_mant_t
989993binary_format<std::float16_t >::max_mantissa_fast_path(am_pow_t power) {
990994 // caller is responsible to ensure that
991995 FASTFLOAT_ASSUME (power >= 0 && power <= 4 );
992- //
996+ # if defined(__clang__)
993997 // Work around clang bug https://godbolt.org/z/zedh7rrhc
994998 return (void )max_mantissa[0 ], max_mantissa[power];
999+ #else
1000+ return max_mantissa[power];
1001+ #endif
9951002}
9961003
9971004template <>
@@ -1077,8 +1084,12 @@ constexpr uint16_t
10771084template <>
10781085inline constexpr std::bfloat16_t
10791086binary_format<std::bfloat16_t >::exact_power_of_ten(am_pow_t power) {
1087+ #if defined(__clang__)
10801088 // Work around clang bug https://godbolt.org/z/zedh7rrhc
1081- return (void )powers_of_ten[0 ], powers_of_ten[power];
1089+ return (void )max_mantissa[0 ], max_mantissa[power];
1090+ #else
1091+ return max_mantissa[power];
1092+ #endif
10821093}
10831094
10841095template <>
@@ -1122,9 +1133,12 @@ inline constexpr am_mant_t
11221133binary_format<std::bfloat16_t >::max_mantissa_fast_path(am_pow_t power) {
11231134 // caller is responsible to ensure that
11241135 FASTFLOAT_ASSUME (power >= 0 && power <= 3 );
1125- //
1136+ # if defined(__clang__)
11261137 // Work around clang bug https://godbolt.org/z/zedh7rrhc
11271138 return (void )max_mantissa[0 ], max_mantissa[power];
1139+ #else
1140+ return max_mantissa[power];
1141+ #endif
11281142}
11291143
11301144template <>
@@ -1186,7 +1200,7 @@ template <>
11861200inline constexpr am_mant_t
11871201binary_format<double >::max_mantissa_fast_path(am_pow_t power) {
11881202 // caller is responsible to ensure that
1189- // FASTFLOAT_ASSUME(power >= 0 && power <= 22);
1203+ FASTFLOAT_ASSUME (power >= 0 && power <= 22 );
11901204#if defined(__clang__)
11911205 // Work around clang bug https://godbolt.org/z/zedh7rrhc
11921206 return (void )max_mantissa[0 ], max_mantissa[power];
@@ -1199,7 +1213,7 @@ template <>
11991213inline constexpr am_mant_t
12001214binary_format<float >::max_mantissa_fast_path(am_pow_t power) {
12011215 // caller is responsible to ensure that
1202- // FASTFLOAT_ASSUME(power >= 0 && power <= 10);
1216+ FASTFLOAT_ASSUME (power >= 0 && power <= 10 );
12031217#if defined(__clang__)
12041218 // Work around clang bug https://godbolt.org/z/zedh7rrhc
12051219 return (void )max_mantissa[0 ], max_mantissa[power];
@@ -1212,7 +1226,7 @@ template <>
12121226inline constexpr double
12131227binary_format<double >::exact_power_of_ten(am_pow_t power) {
12141228 // caller is responsible to ensure that
1215- // FASTFLOAT_ASSUME(power >= 0 && power <= 22);
1229+ FASTFLOAT_ASSUME (power >= 0 && power <= 22 );
12161230#if defined(__clang__)
12171231 // Work around clang bug https://godbolt.org/z/zedh7rrhc
12181232 return (void )powers_of_ten[0 ], powers_of_ten[power];
@@ -1225,7 +1239,7 @@ template <>
12251239inline constexpr float
12261240binary_format<float >::exact_power_of_ten(am_pow_t power) {
12271241 // caller is responsible to ensure that
1228- // FASTFLOAT_ASSUME(power >= 0 && power <= 10);
1242+ FASTFLOAT_ASSUME (power >= 0 && power <= 10 );
12291243#if defined(__clang__)
12301244 // Work around clang bug https://godbolt.org/z/zedh7rrhc
12311245 return (void )powers_of_ten[0 ], powers_of_ten[power];
0 commit comments