]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Patch 18770 from mainline: Detect (and workaround) that gcc3.3 has problems with...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 28 Apr 2009 20:34:22 +0000 (20:34 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 28 Apr 2009 20:34:22 +0000 (20:34 +0000)
git-svn-id: https://svn.dealii.org/branches/releases/Branch-6-2@18771 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure
deal.II/configure.in

index 412c53d4088cd1bd2427342fd745cc05d471336e..d83880452e84f619c3a65302939e313cee5e4c0b 100644 (file)
@@ -4329,6 +4329,60 @@ AC_DEFUN(DEAL_II_CHECK_WSYNTH_AND_STD_COMPLEX, dnl
 ])
 
 
+
+dnl -------------------------------------------------------------
+dnl Older gcc version appear to frown upon the way we write the
+dnl IsBlockMatrix<MatrixType> template. If that's the case,
+dnl remove the -Wctor-dtor-privacy flag.
+dnl
+dnl This is gcc bug 18644:
+dnl   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18644
+dnl
+dnl Usage: DEAL_II_CHECK_CTOR_DTOR_PRIVACY
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_CTOR_DTOR_PRIVACY, dnl
+[
+  if test "x$GXX" = "xyes" ; then
+    AC_MSG_CHECKING(for problem with -Wctor-dtor-privacy)
+    AC_LANG(C++)
+    CXXFLAGS="-Wctor-dtor-privacy -Werror"
+    AC_TRY_COMPILE(
+      [
+      ],
+      [
+template <typename T>
+struct IsInt
+{
+  private:
+    struct yes_type { char c[1]; };
+    struct no_type  { char c[2]; };
+
+    template <typename T>
+    static yes_type check_for_int (const T *);
+
+    static no_type check_for_int (...);
+
+  public:
+    static const bool value = (sizeof(check_for_block_matrix
+                                     ((MatrixType*)0))
+                              ==
+                              sizeof(yes_type));
+};
+
+const bool x = IsInt<double>::value;
+      ],
+      [
+        AC_MSG_RESULT(no)
+      ],
+      [
+        AC_MSG_RESULT(yes)
+       CXXFLAGSG="$CXXFLAGSG -Wno-ctor-dtor-privacy"
+      ])
+  fi
+])
+
+
 dnl -------------------------------------------------------------
 dnl Check for boost option and find pre-installed boost
 dnl -------------------------------------------------------------
index da994199a039990d2772e35115657a7adcf374fe..9e9c7e3a89144c60df214f435093e63dfa28f992 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 18724 .
+# From configure.in Revision: 18740 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for deal.II 6.2.0.
 #
@@ -8233,6 +8233,89 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 
 
+  if test "x$GXX" = "xyes" ; then
+    { echo "$as_me:$LINENO: checking for problem with -Wctor-dtor-privacy" >&5
+echo $ECHO_N "checking for problem with -Wctor-dtor-privacy... $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="-Wctor-dtor-privacy -Werror"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+
+template <typename T>
+struct IsInt
+{
+  private:
+    struct yes_type { char c[1]; };
+    struct no_type  { char c[2]; };
+
+    template <typename T>
+    static yes_type check_for_int (const T *);
+
+    static no_type check_for_int (...);
+
+  public:
+    static const bool value = (sizeof(check_for_block_matrix
+                                     ((MatrixType*)0))
+                              ==
+                              sizeof(yes_type));
+};
+
+const bool x = IsInt<double>::value;
+
+  ;
+  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-ctor-dtor-privacy"
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  fi
+
+
   { echo "$as_me:$LINENO: checking for __PRETTY_FUNCTION__" >&5
 echo $ECHO_N "checking for __PRETTY_FUNCTION__... $ECHO_C" >&6; }
   ac_ext=cpp
index 57a819e9ec9665862063e2fb360f21e867982fa7..653d71e1d7a27614d1700b31e4e4a59e94178342 100644 (file)
@@ -194,6 +194,7 @@ 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_CHECK_CTOR_DTOR_PRIVACY
 DEAL_II_HAVE_PRETTY_FUNCTION
 DEAL_II_HAVE_STD_ITERATOR
 DEAL_II_HAVE_STD_STRINGSTREAM

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.