From 172b031a50d6d9bd95a12fc7116c6e6f3b07ac3d Mon Sep 17 00:00:00 2001 From: denchat <19730041+denchat@users.noreply.github.com> Date: Sat, 17 Apr 2021 21:39:57 +0700 Subject: [PATCH] Suppressing clang complain "forward declaration" Clang complains about "forward declaration of template entity" of all basic_data<>'s members that do not have definitions in `format.h` ``` C:/Users/User/AppData/Roaming/fmt-master/include\fmt/format.h:956:25: warning: instantiation of variable 'fmt::detail::basic_data<>::powers_of_10_64' required here, but no definition is available [-Wundefined-var-template] static const uint64_t powers_of_10_64[]; ^ C:/Users/User/AppData/Roaming/fmt-master/include\fmt/format.h:956:25: note: forward declaration of template entity is here C:/Users/User/AppData/Roaming/fmt-master/include\fmt/format.h:956:25: note: add an explicit instantiation declaration to suppress this warning if 'fmt::detail::basic_data<>::powers_of_10_64' is explicitly instantiated in another translation unit ``` --- include/fmt/format.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/fmt/format.h b/include/fmt/format.h index cbb0a766..270f118a 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3887,6 +3887,29 @@ extern template int snprintf_float(long double value, int precision, float_specs specs, buffer& buf); +extern template const uint64_t basic_data::powers_of_10_64[]; +extern template const uint32_t basic_data::zero_or_powers_of_10_32_new[]; +extern template const uint64_t basic_data::zero_or_powers_of_10_64_new[]; +extern template const uint64_t basic_data::grisu_pow10_significands[]; +extern template const int16_t basic_data::grisu_pow10_exponents[]; +extern template const divtest_table_entry basic_data::divtest_table_for_pow5_32[]; +extern template const divtest_table_entry basic_data::divtest_table_for_pow5_64[]; +extern template const uint64_t basic_data::dragonbox_pow10_significands_64[]; +extern template const uint128_wrapper basic_data::dragonbox_pow10_significands_128[]; +#if !FMT_USE_FULL_CACHE_DRAGONBOX +extern template const uint64_t basic_data::powers_of_5_64[]; +extern template const uint32_t basic_data::dragonbox_pow10_recovery_errors[]; +#endif +// GCC generates slightly better code for pairs than chars. +extern template const basic_data::digit_pair basic_data::digits[]; +extern template const char basic_data::foreground_color[]; +extern template const char basic_data::background_color[]; +extern template const char basic_data::reset_color[5]; +extern template const wchar_t basic_data::wreset_color[5]; +extern template const char basic_data::signs[]; +// DEPRECATED! These are for ABI compatibility. +extern template const uint32_t basic_data::zero_or_powers_of_10_32[]; +extern template const uint64_t basic_data::zero_or_powers_of_10_64[]; } // namespace detail #endif