A better configure test for fixing the IRIX bustage.
git-svn-id: svn://10.0.0.236/trunk@83456 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained 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 T> class ptrClass {
|
||||
public: T* ptr;
|
||||
};
|
||||
|
||||
template <class T> T* a(ptrClass<T> *arg) {
|
||||
return arg->ptr;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const T* a(const ptrClass<T> *arg) {
|
||||
return arg->ptr;
|
||||
}
|
||||
],
|
||||
[ ptrClass<int> 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user