+dnl -------------------------------------------------------------
+dnl gcc 2.95 doesn't like it if we have a member template function
+dnl and define it as a template while specializing the outer class
+dnl template. This is a nasty bug that is hard to work around...
+dnl
+dnl Usage: DEAL_II_CHECK_MEMBER_TEMPLATE_SPECIALIZATION_BUG
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_MEMBER_TEMPLATE_SPECIALIZATION_BUG, dnl
+[
+ AC_MSG_CHECKING(for template member function specialization bug)
+ AC_LANG(C++)
+ CXXFLAGS="$CXXFLAGSG"
+ AC_TRY_COMPILE(
+ [
+ template <int dim> struct X
+ {
+ template <typename T> void f(T);
+ };
+
+ template <>
+ template <typename T>
+ void X<1>::f (T)
+ {}
+
+ template void X<1>::f(int);
+ ],
+ [],
+ [
+ AC_MSG_RESULT(no)
+ ],
+ [
+ AC_MSG_RESULT(yes. using workaround)
+ AC_DEFINE(DEAL_II_MEMBER_VAR_SPECIALIZATION_BUG, 1,
+ [Defined if the compiler refuses to specialize
+ an outer class template while keeping a member
+ as a template. For the exact failure mode, look at
+ aclocal.m4 in the top-level directory.])
+ ])
+])
+
+
+
dnl -------------------------------------------------------------
dnl gcc3.1 (and maybe later compilers) has a bug with long double
dnl and optimization (see code below), when compiling on Sparc
directory for a description of this bug. */
#undef DEAL_II_MEMBER_OP_TEMPLATE_INST
-/* Defined if the compiler refuses to allow the explicit specialization of
- static member variables. For the exact failure mode, look at aclocal.m4 in
- the top-level directory. */
+/* Defined if the compiler refuses to specialize an outer class template while
+ keeping a member as a template. For the exact failure mode, look at
+ aclocal.m4 in the top-level directory. */
#undef DEAL_II_MEMBER_VAR_SPECIALIZATION_BUG
/* Minor version number of deal.II */
_ACEOF
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+
+ echo "$as_me:$LINENO: checking for template member function specialization bug" >&5
+echo $ECHO_N "checking for template member function specialization bug... $ECHO_C" >&6
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ CXXFLAGS="$CXXFLAGSG"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ template <int dim> struct X
+ {
+ template <typename T> void f(T);
+ };
+
+ template <>
+ template <typename T>
+ void X<1>::f (T)
+ {}
+
+ template void X<1>::f(int);
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ echo "$as_me:$LINENO: result: yes. using workaround" >&5
+echo "${ECHO_T}yes. using workaround" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define DEAL_II_MEMBER_VAR_SPECIALIZATION_BUG 1
+_ACEOF
+
+
fi
rm -f conftest.$ac_objext conftest.$ac_ext
dnl
dnl
dnl authors: Wolfgang Bangerth, Guido Kanschat, and others
-dnl 1999, 2000, 2001, 2002
+dnl 1999, 2000, 2001, 2002, 2003, 2004
dnl
DEAL_II_CHECK_NESTED_CLASS_FRIEND_BUG
DEAL_II_CHECK_NESTED_CLASS_TEMPL_FRIEND_BUG
DEAL_II_CHECK_MEMBER_VAR_SPECIALIZATION_BUG
+DEAL_II_CHECK_MEMBER_TEMPLATE_SPECIALIZATION_BUG
DEAL_II_CHECK_LONG_DOUBLE_LOOP_BUG
DEAL_II_CHECK_ANON_NAMESPACE_BUG
DEAL_II_CHECK_ANON_NAMESPACE_BUG2