From 07b1c605510d6f2aff6a4861891f0c0ca64bd276 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 31 Mar 2003 16:32:58 +0000 Subject: [PATCH] Remove some tests that we don't need any more. git-svn-id: https://svn.dealii.org/trunk@7346 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 211 ++++++-------------------- deal.II/base/include/base/config.h.in | 19 +-- deal.II/configure | 185 ++++------------------ deal.II/configure.in | 4 +- 4 files changed, 77 insertions(+), 342 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index feed3bc8bc..29f87fe13e 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -2059,124 +2059,6 @@ template class X<1,int>; -dnl ------------------------------------------------------------- -dnl Intel's ICC 5.0.1 compiler has the following problem: it won't -dnl compile this code: -dnl --------------------------------- -dnl template void encapsulate (void (Class::*fun_ptr)()); -dnl struct X { -dnl void bar () const; -dnl }; -dnl void foo () { -dnl encapsulate(&X::bar); -dnl }; -dnl --------------------------------- -dnl It complains about not finding an instance for the encapsulate function. -dnl The problem is due to the fact that the function we take the address of -dnl is constant, i.e. it should match the template with Class="const X", -dnl but apparently doesn't. Unfortunately, we rely on such code in the -dnl Threads mechanisms. So detect this bug and if present work around it -dnl by providing a second set of encapsulate functions for constant -dnl functions. -dnl -dnl Usage: DEAL_II_CHECK_TEMPL_CONST_MEM_PTR_BUG -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_CHECK_TEMPL_CONST_MEM_PTR_BUG, dnl -[ - AC_MSG_CHECKING(for templates and pointers to const member functions bug) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG" - AC_TRY_COMPILE( - [ - template void encapsulate (void (Class::*fun_ptr)()); - - struct X { - void bar () const; - }; - - void foo () { - encapsulate(&X::bar); - }; - ], - [], - [ - AC_MSG_RESULT(no) - ], - [ - AC_MSG_RESULT(yes. using workaround) - AC_DEFINE(DEAL_II_TEMPL_CONST_MEM_PTR_BUG, 1, - [Define if we have to work around a bug in Intel's icc - compiler in which the compiler refuses to consider a - template when given a pointer to a constant member function. - See the aclocal.m4 file in the top-level directory - for a description of this bug.]) - ]) -]) - - - -dnl ------------------------------------------------------------- -dnl More Intel ICC 5.0.1 compiler lossage with pointers to constant -dnl member functions -dnl --------------------------------- -dnl template struct Y { -dnl typedef void (Class::*FunPtr) (); -dnl FunPtr fun_ptr; -dnl Class *object; -dnl void foo () { -dnl (object->*fun_ptr)(); -dnl }; -dnl }; -dnl -dnl struct X {}; -dnl -dnl template class Y; -dnl --------------------------------- -dnl Again, it does not store the information that the member function pointer -dnl refers to a constant object, so complains that the object is constant, -dnl but the member function is not. -dnl -dnl Usage: DEAL_II_CHECK_CONST_MEM_FUN_PTR_BUG -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_CHECK_CONST_MEM_FUN_PTR_BUG, dnl -[ - AC_MSG_CHECKING(for const member function pointers bug) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG" - AC_TRY_COMPILE( - [ - template struct Y { - typedef void (Class::*FunPtr) (); - FunPtr fun_ptr; - Class *object; - void foo () { - (object->*fun_ptr)(); - }; - }; - - struct X {}; - - template class Y; - ], - [], - [ - AC_MSG_RESULT(no) - ], - [ - AC_MSG_RESULT(yes. using workaround) - AC_DEFINE(DEAL_II_CONST_MEM_FUN_PTR_BUG, 1, - [Define if we have to work around another bug in Intel's icc - compiler in which the compiler refuses to store the const - attribute at a member function pointer with a constant class. - See the aclocal.m4 file in the top-level directory - for a description of this bug.]) - ]) -]) - - - dnl ------------------------------------------------------------- dnl DEC/Compaq's cxx compiler does not want us to implement dnl virtual functions that were declared abstract before. We do @@ -2341,53 +2223,6 @@ AC_DEFUN(DEAL_II_CHECK_NESTED_CLASS_FRIEND_BUG, dnl -dnl ------------------------------------------------------------- -dnl Icc7 gets this wrong: -dnl ---------------------- -dnl class O { -dnl class I { -dnl class II {}; -dnl }; -dnl friend class I::II; -dnl }; -dnl ---------------------- -dnl It complains in the friend declaration that I::II is not accessible. -dnl This is bogus, since we don't need to have access to a class that we -dnl want to grant friendship (friendship goes the other way round). -dnl -dnl We work around this problem, if we encounter it. -dnl -dnl Usage: DEAL_II_CHECK_NESTED_NESTED_FRIEND_BUG -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_CHECK_NESTED_NESTED_FRIEND_BUG, dnl -[ - AC_MSG_CHECKING(for nested nested classes friends bug) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG" - AC_TRY_COMPILE( - [ - class O { - class I { - class II {}; - }; - friend class I::II; - }; - ], - [], - [ - AC_MSG_RESULT(no) - ], - [ - AC_MSG_RESULT(yes. using workaround) - AC_DEFINE(DEAL_II_NESTED_NESTED_FRIEND_BUG, 1, - [Defined if the compiler does not allow to make a class - a friend to which we do not have access.]) - ]) -]) - - - dnl ------------------------------------------------------------- dnl Many compilers get this wrong (see Section 14.7.3.1, number (4)): dnl --------------------------------- @@ -2493,6 +2328,52 @@ AC_DEFUN(DEAL_II_CHECK_LONG_DOUBLE_LOOP_BUG, dnl +dnl ------------------------------------------------------------- +dnl gcc2.95 (but not later compilers) has a bug with taking the +dnl address of a function with template template parameters (or +dnl with calling this function by specifying explicitly the template +dnl arguments). This requires some working around that in turn does +dnl not work with later compilers. +dnl +dnl Usage: DEAL_II_CHECK_FUNPTR_TEMPLATE_TEMPLATE_BUG +dnl +dnl ------------------------------------------------------------- +AC_DEFUN(DEAL_II_CHECK_FUNPTR_TEMPLATE_TEMPLATE_BUG, dnl +[ + AC_MSG_CHECKING(for address of template template function bug) + AC_LANG(C++) + CXXFLAGS="$CXXFLAGSG" + AC_TRY_COMPILE( + [ + template struct X {}; + + template class T> + void f(T); + + template class T> + void g() + { + void (*p) (T) = &f; + } + + template void g<2,X> (); + ], + [], + [ + AC_MSG_RESULT(no) + ], + [ + AC_MSG_RESULT(yes. using workaround) + AC_DEFINE(DEAL_II_FUNPTR_TEMPLATE_TEMPLATE_BUG, 1, + [Defined if the compiler needs a workaround for + certain problems with taking the address of + template template functions. For the details, look at + aclocal.m4 in the top-level directory.]) + ]) +]) + + + dnl ------------------------------------------------------------- dnl We have so many templates in deal.II that sometimes we need dnl to make it clear with which types a template parameter can diff --git a/deal.II/base/include/base/config.h.in b/deal.II/base/include/base/config.h.in index 877fda5431..8acd99eb5f 100644 --- a/deal.II/base/include/base/config.h.in +++ b/deal.II/base/include/base/config.h.in @@ -36,11 +36,10 @@ */ #undef DEAL_II_COMPAT_MAPPING -/* Define if we have to work around another bug in Intel's icc compiler in - which the compiler refuses to store the const attribute at a member - function pointer with a constant class. See the aclocal.m4 file in the - top-level directory for a description of this bug. */ -#undef DEAL_II_CONST_MEM_FUN_PTR_BUG +/* Defined if the compiler needs a workaround for certain problems with taking + the address of template template functions. For the details, look at + aclocal.m4 in the top-level directory. */ +#undef DEAL_II_FUNPTR_TEMPLATE_TEMPLATE_BUG /* Flag indicating whether the library shall be compiled to use the Tecplot interface */ @@ -93,10 +92,6 @@ friends of the enclosing class. */ #undef DEAL_II_NESTED_CLASS_FRIEND_BUG -/* Defined if the compiler does not allow to make a class a friend to which we - do not have access. */ -#undef DEAL_II_NESTED_NESTED_FRIEND_BUG - /* Path to the deal.II directory */ #undef DEAL_II_PATH @@ -115,12 +110,6 @@ the top-level directory. */ #undef DEAL_II_TEMPLATE_TEMPLATE_TYPEDEF_BUG -/* Define if we have to work around a bug in Intel's icc compiler in which the - compiler refuses to consider a template when given a pointer to a constant - member function. See the aclocal.m4 file in the top-level directory for a - description of this bug. */ -#undef DEAL_II_TEMPL_CONST_MEM_PTR_BUG - /* Define if we have to work around a bug with some compilers that will not allow us to specify a fully specialized class of a template as a friend. See the aclocal.m4 file in the top-level directory for a description of diff --git a/deal.II/configure b/deal.II/configure index 75696c0b7b..89d2ca7c04 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision. +# From configure.in Revision: 1.149 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57. # @@ -4479,145 +4479,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -fi -rm -f conftest.$ac_objext conftest.$ac_ext - - - echo "$as_me:$LINENO: checking for templates and pointers to const member functions bug" >&5 -echo $ECHO_N "checking for templates and pointers to const member functions 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 void encapsulate (void (Class::*fun_ptr)()); - - struct X { - void bar () const; - }; - - void foo () { - encapsulate(&X::bar); - }; - -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_TEMPL_CONST_MEM_PTR_BUG 1 -_ACEOF - - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - - - echo "$as_me:$LINENO: checking for const member function pointers bug" >&5 -echo $ECHO_N "checking for const member function pointers 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 struct Y { - typedef void (Class::*FunPtr) (); - FunPtr fun_ptr; - Class *object; - void foo () { - (object->*fun_ptr)(); - }; - }; - - struct X {}; - - template class Y; - -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_CONST_MEM_FUN_PTR_BUG 1 -_ACEOF - - fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4764,8 +4625,8 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:$LINENO: checking for nested classes are implicit friends bug" >&5 -echo $ECHO_N "checking for nested classes are implicit friends bug... $ECHO_C" >&6 + echo "$as_me:$LINENO: checking for address of template template function bug" >&5 +echo $ECHO_N "checking for address of template template function bug... $ECHO_C" >&6 ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4781,14 +4642,18 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - struct X { - private: - static int f(); + template struct X {}; - struct Y { - int g() { return f(); }; - }; - }; + template class T> + void f(T); + + template class T> + void g() + { + void (*p) (T) = &f; + } + + template void g<2,X> (); int main () @@ -4823,7 +4688,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 echo "${ECHO_T}yes. using workaround" >&6 cat >>confdefs.h <<\_ACEOF -#define DEAL_II_NESTED_CLASS_FRIEND_BUG 1 +#define DEAL_II_FUNPTR_TEMPLATE_TEMPLATE_BUG 1 _ACEOF @@ -4831,8 +4696,8 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:$LINENO: checking for nested nested classes friends bug" >&5 -echo $ECHO_N "checking for nested nested classes friends bug... $ECHO_C" >&6 + echo "$as_me:$LINENO: checking for nested classes are implicit friends bug" >&5 +echo $ECHO_N "checking for nested classes are implicit friends bug... $ECHO_C" >&6 ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4848,12 +4713,14 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - class O { - class I { - class II {}; - }; - friend class I::II; - }; + struct X { + private: + static int f(); + + struct Y { + int g() { return f(); }; + }; + }; int main () @@ -4888,7 +4755,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 echo "${ECHO_T}yes. using workaround" >&6 cat >>confdefs.h <<\_ACEOF -#define DEAL_II_NESTED_NESTED_FRIEND_BUG 1 +#define DEAL_II_NESTED_CLASS_FRIEND_BUG 1 _ACEOF diff --git a/deal.II/configure.in b/deal.II/configure.in index 6587524e97..f4f5dce26c 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -169,12 +169,10 @@ DEAL_II_CHECK_MEMBER_OP_TEMPLATE_INST DEAL_II_CHECK_NAMESP_TEMPL_FRIEND_BUG DEAL_II_CHECK_NAMESP_TEMPL_FRIEND_BUG2 DEAL_II_CHECK_TEMPL_SPEC_FRIEND_BUG -DEAL_II_CHECK_TEMPL_CONST_MEM_PTR_BUG -DEAL_II_CHECK_CONST_MEM_FUN_PTR_BUG DEAL_II_CHECK_IMPLEMENTED_PURE_FUNCTION_BUG DEAL_II_CHECK_TEMPLATE_TEMPLATE_TYPEDEF_BUG +DEAL_II_CHECK_FUNPTR_TEMPLATE_TEMPLATE_BUG DEAL_II_CHECK_NESTED_CLASS_FRIEND_BUG -DEAL_II_CHECK_NESTED_NESTED_FRIEND_BUG DEAL_II_CHECK_MEMBER_VAR_SPECIALIZATION_BUG DEAL_II_CHECK_LONG_DOUBLE_LOOP_BUG DEAL_II_CHECK_SFINAE_BUG -- 2.39.5