From 092bb3fc40bb0b188e87e2586192806348b9c140 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 26 Apr 2008 00:11:57 +0000 Subject: [PATCH] Use -Wno-ignored-qualified when we hit gcc bug 36052 git-svn-id: https://svn.dealii.org/trunk@16012 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 47 ++++++++++++++++++++++++++ deal.II/configure | 80 ++++++++++++++++++++++++++++++++++++++++++++ deal.II/configure.in | 3 +- deal.II/lac/Makefile | 2 +- 4 files changed, 130 insertions(+), 2 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index cd65cec506..37a3a8ce1b 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -3883,6 +3883,53 @@ AC_DEFUN(DEAL_II_CHECK_EXPLICIT_CONSTRUCTOR_BUG, dnl +dnl ------------------------------------------------------------- +dnl Check for GCC bug 36052, see +dnl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36052 +dnl +dnl Usage: DEAL_II_CHECK_TYPE_QUALIFIER_BUG +dnl +dnl -------------------------------------------------------------- +AC_DEFUN(DEAL_II_CHECK_TYPE_QUALIFIER_BUG, dnl +[ + case "$GXX_VERSION" in + gcc*) + AC_MSG_CHECKING(for warning bug with type qualifiers) + AC_LANG(C++) + CXXFLAGS="$CXXFLAGSG -Werror" + AC_TRY_COMPILE( + [ + struct S { + typedef double value_type; + }; + + template struct Traits { + typedef const typename T::value_type dereference_type; + }; + + template struct ConstIterator { + typedef typename Traits::dereference_type dereference_type; + + dereference_type operator * () const { return 0; } + }; + + template class ConstIterator; + ], + [ + ], + [ + AC_MSG_RESULT(no) + ], + [ + AC_MSG_RESULT(yes) + CXXFLAGSG="$CXXFLAGSG -Wno-ignored-qualifiers" + ]) + ;; + esac +]) + + + dnl ------------------------------------------------------------- dnl In the gcc libstdc++ headers for std::complex, there is diff --git a/deal.II/configure b/deal.II/configure index 529266de22..b1cdf5978b 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -7303,6 +7303,86 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + case "$GXX_VERSION" in + gcc*) + { echo "$as_me:$LINENO: checking for warning bug with type qualifiers" >&5 +echo $ECHO_N "checking for warning bug with type qualifiers... $ECHO_C" >&6; } + ac_ext=cpp +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 -Werror" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + struct S { + typedef double value_type; + }; + + template struct Traits { + typedef const typename T::value_type dereference_type; + }; + + template struct ConstIterator { + typedef typename Traits::dereference_type dereference_type; + + dereference_type operator * () const { return 0; } + }; + + template class ConstIterator; + +int +main () +{ + + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; 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" >&5 +echo "${ECHO_T}yes" >&6; } + CXXFLAGSG="$CXXFLAGSG -Wno-ignored-qualifiers" + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + esac + + if test "x$GXX" = "xyes" ; then { echo "$as_me:$LINENO: checking for problem with -Wsynth and std::complex" >&5 echo $ECHO_N "checking for problem with -Wsynth and std::complex... $ECHO_C" >&6; } diff --git a/deal.II/configure.in b/deal.II/configure.in index 3b4438ac37..e506b20e08 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -9,7 +9,7 @@ dnl is stored. dnl dnl dnl Copyright: The deal.II authors -dnl 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +dnl 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 dnl @@ -189,6 +189,7 @@ DEAL_II_CHECK_SFINAE_BUG DEAL_II_CHECK_TEMPL_OP_DISAMBIGUATION_BUG DEAL_II_CHECK_ARRAY_CONDITIONAL_DECAY_BUG DEAL_II_CHECK_EXPLICIT_CONSTRUCTOR_BUG +DEAL_II_CHECK_TYPE_QUALIFIER_BUG DEAL_II_CHECK_WSYNTH_AND_STD_COMPLEX DEAL_II_HAVE_PRETTY_FUNCTION DEAL_II_HAVE_STD_ITERATOR diff --git a/deal.II/lac/Makefile b/deal.II/lac/Makefile index 6f97793f67..7153bc9f27 100644 --- a/deal.II/lac/Makefile +++ b/deal.II/lac/Makefile @@ -38,7 +38,7 @@ endif $(LIBDIR)/lac/%.g.$(OBJEXT) : @echo "=====lac==============debug======$(MT)== $(