Add a unique symbol to InstantiationTemplate.cxx.in

A compiler or linker may give an error if a .cxx file is empty (that is,
declares no symbols). This can happen if an instantiation declaration
gets removed during the compile either through preprocessor macros or
SFINAE.

To protect against this, declare a simple integer with a unique symbol
in each instantiation file. The overhead is very small and will prevent
compile/link errors.
This commit is contained in:
Kenneth Moreland 2022-03-28 09:18:23 -06:00
parent 61a44887fd
commit 18461d676f

@ -4,6 +4,9 @@
#include <@INSTANTIATION_TEMPLATE_SOURCE@>
/* Needed for linking errors when no instantiations */
int @INSTANTIATION_INC_GUARD@@counter@__;
@INSTANTIATION_DECLARATION@
#undef @INSTANTIATION_INC_GUARD@