Add test for NEED_CPP_DERIVED_TEMPLATE_OPERATORS.
git-svn-id: svn://10.0.0.236/trunk@69763 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
a4e9dab641
commit
ebc5da3a0a
@ -2428,6 +2428,27 @@ if test "$ac_cv_cpp_partial_specialization" = yes ; then
|
|||||||
fi
|
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 T> class Base { };
|
||||||
|
template <class T>
|
||||||
|
Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
|
||||||
|
template <class T> class Derived : public Base<T> { };],
|
||||||
|
[Derived<char> a, b;
|
||||||
|
Base<char> 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
|
||||||
dnl We dont do exceptions on unix. The only reason this used to be here
|
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
|
dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user