nvhpc/22.3: workaround for c++17 mode. (#3043)

This commit is contained in:
Olli Lupton 2022-08-18 20:30:40 +02:00 committed by GitHub
parent 36c23bd5fd
commit fbb568bce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1557,7 +1557,10 @@ FMT_CONSTEXPR inline fp get_cached_power(int min_exponent,
const int dec_exp_step = 8; const int dec_exp_step = 8;
index = (index - first_dec_exp - 1) / dec_exp_step + 1; index = (index - first_dec_exp - 1) / dec_exp_step + 1;
pow10_exponent = first_dec_exp + index * dec_exp_step; pow10_exponent = first_dec_exp + index * dec_exp_step;
return {data::pow10_significands[index], data::pow10_exponents[index]}; // Using *(x + index) instead of x[index] avoids an issue with some compilers
// using the EDG frontend (e.g. nvhpc/22.3 in C++17 mode).
return {*(data::pow10_significands + index),
*(data::pow10_exponents + index)};
} }
#ifndef _MSC_VER #ifndef _MSC_VER