folly: fix clang's -Wundefined-var-template
authorEric Niebler <eniebler@fb.com>
Thu, 16 Jun 2016 17:08:54 +0000 (10:08 -0700)
committerFacebook Github Bot 2 <facebook-github-bot-2-bot@fb.com>
Thu, 16 Jun 2016 17:23:35 +0000 (10:23 -0700)
commit7570fc58eb757feb6c852275f9573ba0fcbdfdc5
tree1a6b7e54a3127b3070de7e71d2787c04b7c5fb29
parent8fb2b024b0f18d2361ca16b894c0c812d0c8b26d
folly: fix clang's -Wundefined-var-template

Summary:
[temp] (14)/6:
> A function template, member function of a class template, variable template, or static data member of a class template shall be defined in every translation unit in which it is implicitly instantiated (14.7.1) unless the corresponding specialization is explicitly instantiated (14.7.2) in some translation unit; no diagnostic is required.

`-Wundefined-var-template` warns on any implicit instantiations that are needed but could not be performed because the definition is not available. In particular, for valid code, this warns on templates/temploids which have their definition and all relevant explicit instantiations tucked away in some source file (but for which no explicit instantiation declarations are provided in the relevant header file) - used a few times in folly. This seems a bad style, the static data member template should either be defined in the header file or should be explicitly instantiated in each .cpp file.

Reviewed By: igorsugak

Differential Revision: D3270439

fbshipit-source-id: bf305fde3af575a265d65a0ae0bf95db5597587f
folly/Fingerprint.h
folly/SharedMutex.cpp
folly/SharedMutex.h
folly/detail/CacheLocality.cpp
folly/detail/CacheLocality.h
folly/test/CacheLocalityBenchmark.cpp
folly/test/CacheLocalityTest.cpp
folly/test/DeterministicSchedule.cpp
folly/test/SharedMutexTest.cpp