From fbb568bce09347da842e1fcda4277c978f711dd9 Mon Sep 17 00:00:00 2001 From: Olli Lupton Date: Thu, 18 Aug 2022 20:30:40 +0200 Subject: [PATCH] nvhpc/22.3: workaround for c++17 mode. (#3043) --- include/fmt/format.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 047144cf..95604051 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1557,7 +1557,10 @@ FMT_CONSTEXPR inline fp get_cached_power(int min_exponent, const int dec_exp_step = 8; index = (index - first_dec_exp - 1) / dec_exp_step + 1; 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