]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Detect a violation of DR 45.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 24 Jun 2002 11:51:08 +0000 (11:51 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 24 Jun 2002 11:51:08 +0000 (11:51 +0000)
git-svn-id: https://svn.dealii.org/trunk@6180 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/config.h.in
deal.II/configure
deal.II/configure.in

index baab8808fc8f9e272c8db5c658c2c0698a04caec..107ea2bd7f8a4228fafe5b5dcc0c6c27f519c576 100644 (file)
    description of this bug. */
 #undef DEAL_II_NAMESP_TEMPL_FRIEND_BUG
 
+/* Defined if the compiler does not properly implement the resolution of
+   defect report #45 to the C++ standard, which makes nested types implicit
+   friends of the enclosing class. */
+#undef DEAL_II_NESTED_CLASS_FRIEND_BUG
+
 /* Define if we have to work around a bug in Sun's Forte compiler. See the
    aclocal.m4 file in the top-level directory for a description of this bug.
    */
index a02da72747033a6a022a8d3dc4cfa37704b348f0..38244592a535540bf6a211c4dbeb268f0bdbb939 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.112 .
+# From configure.in Revision: 1.113 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.53a.
 #
@@ -4399,6 +4399,73 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 
+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
+  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"
+#include "confdefs.h"
+
+       class X {
+           static int i;
+
+           struct Y {
+               int f() { return i; };
+           };
+       };
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+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
+cat 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_NESTED_CLASS_FRIEND_BUG 1
+_ACEOF
+
+
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
index 9f31b0045ca4eba422ce607570a6c4c463a32b06..ee8b6589e87d77b02b930fbb8d024334387020b3 100644 (file)
@@ -160,6 +160,7 @@ 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
 DEAL_II_CHECK_MEMBER_VAR_SPECIALIZATION_BUG
 DEAL_II_HAVE_PRETTY_FUNCTION
 DEAL_II_HAVE_STD_ITERATOR

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.