From 47817685159b560eda20c3b41bba51eb2fb7fc51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Sch=C3=B6pflin?= Date: Wed, 6 Jul 2005 13:08:39 +0000 Subject: [PATCH] Workaround for Tru64/CXX to avoid multiple definitions of static variables. [SVN r29907] --- test/regress/info.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/regress/info.hpp b/test/regress/info.hpp index c8e0120a..0371442b 100644 --- a/test/regress/info.hpp +++ b/test/regress/info.hpp @@ -140,6 +140,20 @@ struct test_info : public test_info_base {}; +#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) + +// Some template instantiation modes (namely local, implicit local, and weak) of +// this compiler need an explicit instantiation because otherwise we end up with +// multiple copies of the static variable defined in this method. This explicit +// instantiation generates the static variable with common linkage, which makes +// the linker choose only one of the available definitions. For more details, +// see "man ld". + +template test_info_base::data_type & test_info_base::data(); +template test_info_base::data_type & test_info_base::data(); + +#endif + template std::ostream& operator<<(std::ostream& os, const test_info&) {