-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppressing clang complain "forward declaration" #2241
Conversation
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 ```
Remove FMT_API. Try hiding the extern template's members declaration from msvc instead.
- Added FMT_INSTANTIATION_DECL_API - Added non-msvc filter - Added msvc non-export filter
Added FMT_INSTANTIATION_DEF_API in definition in format-inl.h
I'm not sure whether I can remove |
Please do. |
Is |
It seems clang complains only at the data members that do not have definition, e.g. In contrast, ones that are already defined, e.g.
If you think clang is overreacting beyond the standard specified, we can add |
Thinking more of it, we should just move most static data to functions where it is used and make the rest constexpr. This will eliminate the need to export anything (c47f211). Thanks for looking into it anyway. |
Clang complains about "forward declaration of template entity" of all basic_data<>'s members that do not have definitions in
format.h