diff --git a/include/boost/config/compiler/common_edg.hpp b/include/boost/config/compiler/common_edg.hpp index c2559695..bb442a22 100644 --- a/include/boost/config/compiler/common_edg.hpp +++ b/include/boost/config/compiler/common_edg.hpp @@ -62,6 +62,7 @@ #if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG) // No support for initializer lists # define BOOST_NO_INITIALIZER_LISTS +# define BOOST_NO_EXTERN_TEMPLATE #endif #define BOOST_NO_AUTO_DECLARATIONS @@ -74,7 +75,6 @@ #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS #define BOOST_NO_LAMBDAS #define BOOST_NO_NULLPTR diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index 463bf5dd..b9b42bdb 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -42,6 +42,7 @@ # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_NO_IS_ABSTRACT +# define BOOST_NO_EXTERN_TEMPLATE #elif __GNUC__ == 3 # if defined (__PATHSCALE__) # define BOOST_NO_TWO_PHASE_NAME_LOOKUP @@ -58,6 +59,7 @@ # if __GNUC_MINOR__ < 4 # define BOOST_NO_IS_ABSTRACT # endif +# define BOOST_NO_EXTERN_TEMPLATE #endif #if __GNUC__ < 4 // @@ -119,7 +121,6 @@ // C++0x features not implemented in any GCC version // #define BOOST_NO_CONSTEXPR -#define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_NULLPTR #define BOOST_NO_TEMPLATE_ALIASES diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 93bbb674..b34db6f1 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -68,6 +68,7 @@ # define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS # define BOOST_NO_IS_ABSTRACT # define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS +# define BOOST_NO_EXTERN_TEMPLATE // TODO: what version is meant here? Have there really been any fixes in cl 12.01 (as e.g. shipped with eVC4)? # if (_MSC_VER > 1200) # define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS @@ -186,7 +187,6 @@ #define BOOST_NO_DECLTYPE #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS #define BOOST_NO_INITIALIZER_LISTS #define BOOST_NO_RAW_LITERALS diff --git a/test/boost_no_extern_template.ipp b/test/boost_no_extern_template.ipp index 732eedc6..0965470b 100644 --- a/test/boost_no_extern_template.ipp +++ b/test/boost_no_extern_template.ipp @@ -12,7 +12,26 @@ namespace boost_no_extern_template { -extern template void f(T); +template void f(T const* p, U const* q) +{ + p = q; +} + +template +class must_not_compile +{ +public: + void f(T const* p, int const* q); +}; + +template +void must_not_compile::f(T const* p, int const* q) +{ + p = q; +} + +extern template void f<>(int const*, float const*); +extern template class must_not_compile; int test() {