Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jun 25, 2016

Building under a recent clang compiler causes the use of an extern
template for the BasicData struct. However, the only instantiation of
that structure in format.cc is only done if FMT_HEADER_ONLY is not
defined. This causes the build to fail in C++11 or C++14 mode.
Therefore, only declare the BasicData template as extern if
FMT_HEADER_ONLY is not defined.

Building under a recent clang compiler causes the use of an extern
template for the BasicData struct. However, the only instantiation of
that structure in format.cc is only done if FMT_HEADER_ONLY is not
defined. This causes the build to fail in C++11 or C++14 mode.
Therefore, only declare the BasicData template as extern if
FMT_HEADER_ONLY is not defined.
@ghost
Copy link
Author

ghost commented Jun 25, 2016

Quick note: I'm working with Apple's Clang version 7.3.0. This change allows the code to compile in header-only mode under clang when compiling in either C++11 or C++14 mode. Thanks!

@vitaut vitaut merged commit 44c926d into fmtlib:master Jun 27, 2016
@vitaut
Copy link
Contributor

vitaut commented Jun 27, 2016

Good catch, thanks!

@ghost ghost deleted the fix-clang-extern-header-only branch June 27, 2016 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant