]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
The last (reduced) check-in works with gcc, but breaks icc, unfortunately. This is...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 8 Jan 2003 15:23:48 +0000 (15:23 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 8 Jan 2003 15:23:48 +0000 (15:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@6889 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/base/include/base/config.h.in
deal.II/base/include/base/thread_management.h
deal.II/configure
deal.II/configure.in

index e1f50cd52236a9d61827ec3f2c694af88493a897..1d71d3387e1997c417fe2db77b7de7e26e61935b 100644 (file)
@@ -1965,6 +1965,67 @@ AC_DEFUN(DEAL_II_CHECK_TEMPL_CONST_MEM_PTR_BUG, dnl
 
 
 
+dnl -------------------------------------------------------------
+dnl More Intel ICC 5.0.1 compiler lossage with pointers to constant
+dnl member functions
+dnl ---------------------------------
+dnl template <class Class> 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<const X>;
+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 <class Class> struct Y {
+         typedef void (Class::*FunPtr) ();
+         FunPtr fun_ptr;
+         Class *object;
+         void foo () {
+           (object->*fun_ptr)();
+         };
+       };
+
+       struct X {};
+
+       template class Y<const X>;
+    ],
+    [],
+    [
+      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
index 742111ade499de1830a539aef2abefefc3566508..a8ac42bce91805abc52cf0c9ef927dc6fcbe1638 100644 (file)
    */
 #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
+
 /* Flag indicating whether the library shall be compiled to use the Tecplot
    interface */
 #undef DEAL_II_HAVE_TECPLOT
index a5461d29b9578e4a73da9ddac5b25b38d5ff1915..d091a3910598661c194e655b80918cb16124b614 100644 (file)
@@ -412,17 +412,21 @@ namespace Threads
       typedef RetType (Class::*type) ();
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class RetType>
   struct MemFunPtr0<const Class, RetType>
   {
       typedef RetType (Class::*type) () const;
   };
-
+#endif  
                                   /**
                                    * Given a class, argument types,
                                    * and the return type, generate a
@@ -435,17 +439,21 @@ namespace Threads
       typedef RetType (Class::*type) (Arg1);
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class Arg1, class RetType>
   struct MemFunPtr1<const Class, Arg1, RetType>
   {
       typedef RetType (Class::*type) (Arg1) const;
   };
-
+#endif  
                                   /**
                                    * Given a class, argument types,
                                    * and the return type, generate a
@@ -458,17 +466,21 @@ namespace Threads
       typedef RetType (Class::*type) (Arg1, Arg2);
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class Arg1, class Arg2, class RetType>
   struct MemFunPtr2<const Class, Arg1, Arg2, RetType>
   {
       typedef RetType (Class::*type) (Arg1, Arg2) const;
   };
-
+#endif  
 
                                   /**
                                    * Given a class, argument types,
@@ -482,17 +494,21 @@ namespace Threads
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3);
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class Arg1, class Arg2, class Arg3, class RetType>
   struct MemFunPtr3<const Class, Arg1, Arg2, Arg3, RetType>
   {
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3) const;
   };
-
+#endif  
 
                                   /**
                                    * Given a class, argument types,
@@ -506,17 +522,21 @@ namespace Threads
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4);
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class Arg1, class Arg2, class Arg3, class Arg4, class RetType>
   struct MemFunPtr4<const Class, Arg1, Arg2, Arg3, Arg4, RetType>
   {
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4) const;
   };
-
+#endif  
 
                                   /**
                                    * Given a class, argument types,
@@ -530,17 +550,21 @@ namespace Threads
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5);
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class RetType>
   struct MemFunPtr5<const Class, Arg1, Arg2, Arg3, Arg4, Arg5, RetType>
   {
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5) const;
   };
-
+#endif  
 
                                   /**
                                    * Given a class, argument types,
@@ -554,17 +578,21 @@ namespace Threads
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6);
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class RetType>
   struct MemFunPtr6<const Class, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, RetType>
   {
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6) const;
   };
-
+#endif  
 
                                   /**
                                    * Given a class, argument types,
@@ -578,17 +606,21 @@ namespace Threads
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7);
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class RetType>
   struct MemFunPtr7<const Class, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, RetType>
   {
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7) const;
   };
-
+#endif  
 
 
                                   /**
@@ -603,17 +635,21 @@ namespace Threads
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8);
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class RetType>
   struct MemFunPtr8<const Class, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, RetType>
   {
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8) const;
   };
-
+#endif  
 
 
 
@@ -629,17 +665,21 @@ namespace Threads
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9);
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class Arg9, class RetType>
   struct MemFunPtr9<const Class, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, RetType>
   {
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9) const;
   };
-
+#endif  
 
   
 
@@ -656,17 +696,21 @@ namespace Threads
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10);
   };
 
+#ifdef DEAL_II_CONST_MEM_FUN_PTR_BUG
                                   /**
                                    * Same as above, but for the case
                                    * of a member function marked
-                                   * @p{const}.
+                                   * @p{const}. This should not
+                                   * really be necessary, but Intel's
+                                   * compiler has a bug here so we
+                                   * have to work around.
                                    */
   template <class Class, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class Arg9, class Arg10, class RetType>
   struct MemFunPtr10<const Class, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, RetType>
   {
       typedef RetType (Class::*type) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10) const;
   };
-
+#endif  
 
   
   
index 5ac02669f521a5a1415a5488220ad17ce164e58c..37f4160dbd134bf64c6a3fb3f65b27a6ba3a691c 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.134 .
+# From configure.in Revision: 1.135 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.57.
 #
@@ -4419,6 +4419,77 @@ cat >>confdefs.h <<\_ACEOF
 _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 <class Class> struct Y {
+         typedef void (Class::*FunPtr) ();
+         FunPtr fun_ptr;
+         Class *object;
+         void foo () {
+           (object->*fun_ptr)();
+         };
+       };
+
+       struct X {};
+
+       template class Y<const X>;
+
+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
 
index c6631de14bb24397502d81a43584124160c888c7..5a0470888715d1cac47656c2cd0d0c098558813f 100644 (file)
@@ -170,6 +170,7 @@ DEAL_II_CHECK_MEMBER_OP_TEMPLATE_INST
 DEAL_II_CHECK_NAMESP_TEMPL_FRIEND_BUG
 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_NESTED_CLASS_FRIEND_BUG

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.