Skip to content
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

Clang keeps complain it ignores __declspec(dllexport) of basic_data<void> template instantitation definition in format.cc #2220

Merged
merged 13 commits into from
Apr 12, 2021
Merged
4 changes: 1 addition & 3 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -995,9 +995,7 @@ FMT_INLINE uint16_t bsr2log10(int bsr) {
return data[bsr];
}

#ifndef FMT_EXPORTED
FMT_EXTERN template struct basic_data<void>;
#endif
FMT_EXTERN template struct FMT_INSTANTIATION_DEF_API basic_data<void>;

// This is a struct rather than an alias to avoid shadowing warnings in gcc.
struct data : basic_data<> {};
Expand Down
2 changes: 1 addition & 1 deletion src/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ vformat_to(buffer<char>&, string_view,
type_identity_t<char>>>);
} // namespace detail

template struct FMT_INSTANTIATION_DEF_API detail::basic_data<void>;
template struct detail::basic_data<void>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a short comment saying that clang doesn't allow __declspec(dllexport) here.


// Workaround a bug in MSVC2013 that prevents instantiation of format_float.
int (*instantiate_format_float)(double, int, detail::float_specs,
Expand Down