Add HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX test; make HAVE_CPP_SPECIALIZATION test a bit more lax; make HAVE_CPP_USING a bit more rigorous. r=scc

git-svn-id: svn://10.0.0.236/trunk@64001 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
waterson%netscape.com 2000-03-24 05:59:28 +00:00
parent adcf7dec28
commit cb9de0c698

View File

@ -2194,7 +2194,7 @@ AC_CACHE_CHECK(for C++ template specialization support,
ac_cv_cpp_template_specialization,
[AC_TRY_COMPILE(template <class T> struct X { int a; };
class Y {};
template <> struct X<Y> { double a; };,
struct X<Y> { double a; };,
X<int> int_x;
X<Y> y_x;,
ac_cv_cpp_template_specialization=yes,
@ -2217,6 +2217,21 @@ if test "$ac_cv_cpp_template_specialization" = yes ; then
AC_DEFINE(HAVE_CPP_SPECIALIZATION)
fi
dnl Check for support of modern template specialization syntax
dnl Test code and requirement from scc@netscape.com.
dnl Autoconf cut-and-paste job by waterson@netscape.com
AC_CACHE_CHECK(for modern C++ template specialization syntax support,
ac_cv_cpp_modern_specialize_template_syntax,
[AC_TRY_COMPILE(template <class T> struct X { int a; };
class Y {};
template <> struct X<Y> { double a; };,
X<int> int_x;
X<Y> y_x;,
ac_cv_cpp_modern_specialize_template_syntax=yes,
ac_cv_cpp_modern_specialize_template_syntax=no)])
if test "$ac_cv_cpp_template_specialization" = yes ; then
AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
fi
dnl
dnl We dont do exceptions on unix. The only reason this used to be here
@ -2239,8 +2254,9 @@ dnl fi
AC_CACHE_CHECK(for C++ \"using\" keyword,
ac_cv_cpp_using,
[AC_TRY_COMPILE(class X { public: int go() {return 3;} };
[AC_TRY_COMPILE(class X { public: int go(const X&) {return 3;} };
class Y : public X {
public: int go(int) {return 2;}
private: using X::go;
};,
X x; Y y;,