From ebc5da3a0aaa93ca27df4fcc425f29d142d99ded Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Mon, 15 May 2000 07:18:54 +0000 Subject: [PATCH] Add test for NEED_CPP_DERIVED_TEMPLATE_OPERATORS. git-svn-id: svn://10.0.0.236/trunk@69763 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/configure.in | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mozilla/configure.in b/mozilla/configure.in index e294ae5a7f9..9e67c1b044b 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -2428,6 +2428,27 @@ if test "$ac_cv_cpp_partial_specialization" = yes ; then fi +dnl Some compilers have limited support for operators with templates; +dnl specifically, it is necessary to define derived operators when a base +dnl class's operator declaration should suffice. +AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates, + ac_cv_need_derived_template_operators, + [AC_TRY_COMPILE([template class Base { }; + template + Base operator+(const Base& lhs, const Base& rhs) { return lhs; } + template class Derived : public Base { };], + [Derived a, b; + Base c = a + b; + return 0;], + ac_cv_need_derived_template_operators=no, + ac_cv_need_derived_template_operators=yes)]) +if test "$ac_cv_need_derived_template_operators" = yes ; then + AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS) +fi + + + + dnl dnl We dont do exceptions on unix. The only reason this used to be here dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses