From 50436dd93fe151bd5cf7dc8b139831901a97b47f Mon Sep 17 00:00:00 2001 From: "dbaron%fas.harvard.edu" Date: Sun, 10 Dec 2000 04:27:38 +0000 Subject: [PATCH] A better configure test for fixing the IRIX bustage. git-svn-id: svn://10.0.0.236/trunk@83456 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/configure.in | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/mozilla/configure.in b/mozilla/configure.in index d1286c65ac8..1cb54c39f8b 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -2645,14 +2645,27 @@ fi dnl Some compilers have trouble resolving the ambiguity between two dnl functions whose arguments differ only by cv-qualifications. -AC_CACHE_CHECK(whether the compiler cannot resolve const ambiguities correctly, - ac_cv_cant_resolve_const_ambiguity, - [AC_TRY_COMPILE([int a(int *i) { return *i; } - const int a(const int *i) { return *i; } ], - [ int i; a(&i); ], - ac_cv_cant_resolve_const_ambiguity=no, - ac_cv_cant_resolve_const_ambiguity=yes)]) -if test "$ac_cv_cant_resolve_const_ambiguity" = yes ; then +AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates, + ac_cv_can_resolve_const_ambiguity, + [AC_TRY_COMPILE([ + template class ptrClass { + public: T* ptr; + }; + + template T* a(ptrClass *arg) { + return arg->ptr; + } + + template + const T* a(const ptrClass *arg) { + return arg->ptr; + } + ], + [ ptrClass i; + a(&i); ], + ac_cv_can_resolve_const_ambiguity=yes, + ac_cv_can_resolve_const_ambiguity=no)]) +if test "$ac_cv_can_resolve_const_ambiguity" = no ; then AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY) fi