From 26277d2d628acbd3d6757363e4038b3af6d0a86f Mon Sep 17 00:00:00 2001 From: maier Date: Fri, 28 Sep 2012 15:30:51 +0000 Subject: [PATCH] Remove old bug tests for gcc versions <= 3.4 git-svn-id: https://svn.dealii.org/branches/branch_cmake@26841 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/bugs.m4 | 702 ------------------- deal.II/include/deal.II/base/config.h.in.old | 45 -- 2 files changed, 747 deletions(-) diff --git a/deal.II/cmake/bugs.m4 b/deal.II/cmake/bugs.m4 index 0f65774b90..6f9a235436 100644 --- a/deal.II/cmake/bugs.m4 +++ b/deal.II/cmake/bugs.m4 @@ -78,66 +78,6 @@ AC_DEFUN(DEAL_II_CHECK_PARTLY_BRACKETED_INITIALIZER, dnl -dnl ------------------------------------------------------------- -dnl Check whether some backward compatibility features are disabled -dnl Usage: -dnl DEAL_II_CHECK_COMPAT_BLOCKER -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_CHECK_COMPAT_BLOCKER, dnl -[ - AC_ARG_ENABLE(compat-blocker, - [AS_HELP_STRING([--enable-compat-blocker=mapping], - [Block functions that implicitely assume a Q1 mapping])], - enable_compat_blocker="$enableval", - enable_compat_blocker="") - - dnl Replace the comma-separated list by a space-separated one - disable_compat=`echo $enable_compat_blocker | perl -pi -e 's/,/ /g;'` - - dnl Check that each entry is an allowed one - for i in $disable_compat ; do - case $i in - mapping) - AC_MSG_RESULT(Disabling backward compatibility feature: "$i") - ;; - *) - AC_MSG_ERROR(Backward compatibility feature "$i" unknown) - ;; - esac - done - - dnl Now for each known feature, either disable it or enable it. - dnl Default is to enable. In order to have these flags in config.h, - dnl it is necessary to AC_DEFINE them actually by name, rather than - dnl by some loop variable, since otherwise autoheader can't generate - dnl an entry for config.h for this variable - for i in mapping ; do - uppercase=`echo $i | perl -pi -e 'tr/a-z/A-Z/;'` - if test -n "`echo $disable_compat | grep $i`" ; then - compat_value=false - else - compat_value=true - fi - - case $i in - mapping) - AC_DEFINE_UNQUOTED(DEAL_II_COMPAT_MAPPING,$compat_value, - [Backward compatibility support for functions - and classes that do not take an explicit - mapping variable, but rather use a default - Q1 mapping instead]) - ;; - - *) - AC_MSG_ERROR(Backward compatibility feature "$i" unknown) - ;; - esac - done -]) - - - dnl ------------------------------------------------------------- dnl On SunOS 4.x, the `getrusage' function exists, but is not declared dnl in the respective header file `resource.h', as one would think when @@ -183,108 +123,6 @@ AC_DEFUN(DEAL_II_CHECK_GETRUSAGE, dnl -dnl ------------------------------------------------------------- -dnl On some systems (well, DEC Alphas are the only ones we know of), -dnl gcc2.95 throws the hands in the air if it sees one of the AssertThrow -dnl calls, and dies with an internal compiler error. If this is the case, -dnl we disable AssertThrow and simply replace it with an `abort' if the -dnl condition is not satisfied. -dnl -dnl Usage: DEAL_II_CHECK_ASSERT_THROW("description of options set", -dnl "compiler options set", -dnl action if compiler crashes) -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_CHECK_ASSERT_THROW, dnl -[ - AC_MSG_CHECKING(whether AssertThrow works with $1 flags) - AC_LANG(C++) - CXXFLAGS="$2" - AC_TRY_COMPILE( - [ -#include -#include -#include - -#ifndef __GNUC__ -# define __PRETTY_FUNCTION__ "(unknown)" -#endif -class ExceptionBase : public std::exception { - public: - ExceptionBase (); - ExceptionBase (const char* f, const int l, const char *func, - const char* c, const char *e); - virtual ~ExceptionBase () throw(); - void SetFields (const char *f, const int l, const char *func, - const char *c, const char *e); - void PrintExcData (std::ostream &out) const; - virtual void PrintInfo (std::ostream &out) const; - virtual const char * what () const throw (); - protected: - const char *file; - unsigned int line; - const char *function, *cond, *exc; -}; - -template -void __IssueError_Assert (const char *file, - int line, - const char *function, - const char *cond, - const char *exc_name, - exc e){ - e.SetFields (file, line, function, cond, exc_name); - std::cerr << "--------------------------------------------------------" - << std::endl; - e.PrintExcData (std::cerr); - e.PrintInfo (std::cerr); - std::cerr << "--------------------------------------------------------" - << std::endl; - std::abort (); -} - -template -void __IssueError_Throw (const char *file, - int line, - const char *function, - const char *cond, - const char *exc_name, - exc e) { - // Fill the fields of the exception object - e.SetFields (file, line, function, cond, exc_name); - throw e; -} - -#define AssertThrow(cond, exc) \ - { \ - if (!(cond)) \ - __IssueError_Throw (__FILE__, \ - __LINE__, \ - __PRETTY_FUNCTION__, #cond, #exc, exc); \ - } - -#define DeclException0(Exception0) \ -class Exception0 : public ExceptionBase {} - -namespace StandardExceptions -{ - DeclException0 (ExcInternalError); -} -using namespace StandardExceptions; - ], - [ - AssertThrow (false, ExcInternalError()); - ], - [ - AC_MSG_RESULT(yes) - ], - [ - AC_MSG_RESULT(no) - $3 - ]) -]) - - dnl ------------------------------------------------------------- dnl Sun's Forte compiler (at least up to the Version 7 Early Access @@ -406,148 +244,6 @@ AC_DEFUN(DEAL_II_CHECK_TEMPLATE_SPEC_ACCESS, dnl ]) -dnl ------------------------------------------------------------- -dnl Versions of GCC before 3.0 had a problem with the following -dnl code: -dnl -dnl /* ----------------------------------------------- */ -dnl namespace NS { -dnl template class C { -dnl template friend class C; -dnl }; -dnl }; -dnl /* ----------------------------------------------- */ -dnl -dnl This is fixed with gcc at least in snapshots before version 3.1, -dnl but the following bug remains: -dnl -dnl /* ----------------------------------------------- */ -dnl namespace NS { template class C; }; -dnl -dnl template class X { -dnl template friend class NS::C; -dnl }; -dnl -dnl template class X; -dnl /* ----------------------------------------------- */ -dnl -dnl The compiler gets an internal error for these cases. Since we need this -dnl construct at various places, we check for it and if the compiler -dnl dies, we use a workaround that is non-ISO C++ but works for these -dnl compilers. -dnl -dnl Usage: DEAL_II_CHECK_NAMESP_TEMPL_FRIEND_BUG -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_CHECK_NAMESP_TEMPL_FRIEND_BUG, dnl -[ - AC_MSG_CHECKING(for 1st template friend in namespace bug) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG" - AC_TRY_COMPILE( - [ - namespace NS { - template class C { - C(const C&); - template friend class C; - }; - } - - namespace NS2 { template class C; } - - template class X { - template friend class NS2::C; - template friend class NS::C; - }; - - template class X; - - namespace NS { - template - inline C::C(const C&) - {} - } - ], - [], - [ - AC_MSG_RESULT(no) - ], - [ - AC_MSG_RESULT(yes. using workaround) - AC_DEFINE_UNQUOTED(DEAL_II_NAMESP_TEMPL_FRIEND_BUG, 1, - [Define if we have to work around a bug in gcc with - marking all instances of a template class as friends - to this class if the class is inside a namespace. - See the aclocal.m4 file in the top-level directory - for a description of this bug.]) - ]) -]) - - - -dnl ------------------------------------------------------------- -dnl Another bug in gcc with template and namespaces (fixed since 3.2, -dnl but present in 3.0): -dnl -dnl /* ----------------------------------------------- */ -dnl namespace NS { -dnl template struct Foo; -dnl } -dnl -dnl class Bar { -dnl template friend struct NS::Foo; -dnl }; -dnl -dnl namespace NS { -dnl template struct Foo { Foo (); }; -dnl } -dnl -dnl template struct NS::Foo; -dnl /* ----------------------------------------------- */ -dnl -dnl gcc2.95 provides a really unhelpful error message, 3.0 gets an -dnl internal compiler error. -dnl -dnl Usage: DEAL_II_CHECK_NAMESP_TEMPL_FRIEND_BUG2 -dnl -dnl ------------------------------------------------------------- -AC_DEFUN(DEAL_II_CHECK_NAMESP_TEMPL_FRIEND_BUG2, dnl -[ - AC_MSG_CHECKING(for 2nd template friend in namespace bug) - AC_LANG(C++) - CXXFLAGS="$CXXFLAGSG -Werror" - AC_TRY_COMPILE( - [ - namespace NS { - template struct Foo; - } - - class Bar { - template friend struct NS::Foo; - }; - - namespace NS { - template struct Foo { Foo (); }; - } - - template struct NS::Foo; - ], - [], - [ - AC_MSG_RESULT(no) - ], - [ - AC_MSG_RESULT(yes. using workaround) - AC_DEFINE_UNQUOTED(DEAL_II_NAMESP_TEMPL_FRIEND_BUG2, 1, - [Define if we have to work around another bug in gcc with - marking all instances of a template class as friends - to this class if the class is inside a namespace. - See the aclocal.m4 file in the top-level directory - for a description of this bug.]) - ]) -]) - - dnl ------------------------------------------------------------- dnl In some cases, we would like to name partial specializations @@ -662,177 +358,6 @@ AC_DEFUN(DEAL_II_CHECK_IMPLEMENTED_PURE_FUNCTION_BUG, dnl -dnl ------------------------------------------------------------- -dnl gcc 2.95 dies on this construct: -dnl ----------------------------- -dnl template struct TT { typedef int type; }; -dnl -dnl template