+dnl -------------------------------------------------------------
+dnl Some compiler versions, notably ICC, have trouble with the
+dnl following code in which we explicitly call a destructor.
+dnl This has to be worked around with a typedef. The problem is
+dnl that the workaround fails with some other compilers, so that
+dnl we can not unconditionally use the workaround...
+dnl
+dnl Usage: DEAL_II_CHECK_EXPLICIT_DESTRUCTOR_BUG
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_EXPLICIT_DESTRUCTOR_BUG, dnl
+[
+ AC_MSG_CHECKING(for explicit destructor call bug)
+ AC_LANG(C++)
+ CXXFLAGS="$CXXFLAGSG"
+ AC_TRY_COMPILE(
+ [
+ namespace dealii
+ {
+ namespace FEValuesViews
+ {
+ template <int dim, int spacedim> struct Scalar {};
+ }
+
+ template <int dim, int spacedim>
+ struct X
+ {
+ FEValuesViews::Scalar<dim,spacedim> scalars[dim*spacedim];
+
+ void f()
+ {
+ scalars[0].dealii::FEValuesViews::Scalar<dim,spacedim>::~Scalar ();
+ }
+ };
+
+ template struct X<2,2>;
+ }
+ ],
+ [],
+ [
+ AC_MSG_RESULT(no)
+ ],
+ [
+ AC_MSG_RESULT(yes. using workaround)
+ AC_DEFINE_UNQUOTED(DEAL_II_EXPLICIT_DESTRUCTOR_BUG, 1,
+ [Define if we have to work around a bug where the
+ compiler doesn't accept an explicit destructor call.
+ See the aclocal.m4 file in the top-level directory
+ for a description of this bug.])
+ ])
+])
+
+
dnl -------------------------------------------------------------
dnl Versions of GCC before 3.0 had a problem with the following
dnl code:
constructors. */
#undef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG
+/* Define if we have to work around a bug where the compiler doesn't accept an
+ explicit destructor call. See the aclocal.m4 file in the top-level
+ directory for a description of this bug. */
+#undef DEAL_II_EXPLICIT_DESTRUCTOR_BUG
+
/* Defined if the compiler needs a workaround for certain problems with taking
the address of template template functions. For the details, look at
aclocal.m4 in the top-level directory. */
+ { $as_echo "$as_me:$LINENO: checking for explicit destructor call bug" >&5
+$as_echo_n "checking for explicit destructor call bug... " >&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"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ namespace dealii
+ {
+ namespace FEValuesViews
+ {
+ template <int dim, int spacedim> struct Scalar {};
+ }
+
+ template <int dim, int spacedim>
+ struct X
+ {
+ FEValuesViews::Scalar<dim,spacedim> scalars[dim*spacedim];
+
+ void f()
+ {
+ scalars[0].dealii::FEValuesViews::Scalar<dim,spacedim>::~Scalar ();
+ }
+ };
+
+ template struct X<2,2>;
+ }
+
+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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$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
+ $as_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
+
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ { $as_echo "$as_me:$LINENO: result: yes. using workaround" >&5
+$as_echo "yes. using workaround" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define DEAL_II_EXPLICIT_DESTRUCTOR_BUG 1
+_ACEOF
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
{ $as_echo "$as_me:$LINENO: checking for 1st template friend in namespace bug" >&5
$as_echo_n "checking for 1st template friend in namespace bug... " >&6; }
ac_ext=cpp
DEAL_II_CHECK_LOCAL_TYPEDEF_COMP
DEAL_II_CHECK_TEMPLATE_SPEC_ACCESS
DEAL_II_CHECK_MEMBER_OP_TEMPLATE_INST
+DEAL_II_CHECK_EXPLICIT_DESTRUCTOR_BUG
DEAL_II_CHECK_NAMESP_TEMPL_FRIEND_BUG
DEAL_II_CHECK_NAMESP_TEMPL_FRIEND_BUG2
DEAL_II_CHECK_TEMPL_SPEC_FRIEND_BUG
scalars.resize (n_scalars);
for (unsigned int component=0; component<n_scalars; ++component)
{
+#ifndef DEAL_II_EXPLICIT_DESTRUCTOR_BUG
+ scalars[component].dealii::FEValuesViews::Scalar<dim,spacedim>::~Scalar ();
+#else
typedef dealii::FEValuesViews::Scalar<dim,spacedim> ScalarView;
- scalars[component].ScalarView::~Scalar ();
+ scalars[component].ScalarView::~ScalarView ();
+#endif
new (&scalars[component])
dealii::FEValuesViews::Scalar<dim,spacedim>(fe_values,
component);
vectors.resize (n_vectors);
for (unsigned int component=0; component<n_vectors; ++component)
{
+#ifndef DEAL_II_EXPLICIT_DESTRUCTOR_BUG
+ vectors[component].dealii::FEValuesViews::Vector<dim,spacedim>::~Vector ();
+#else
typedef dealii::FEValuesViews::Vector<dim,spacedim> VectorView;
- vectors[component].VectorView::~Vector ();
+ vectors[component].VectorView::~VectorView ();
+#endif
new (&vectors[component])
dealii::FEValuesViews::Vector<dim,spacedim>(fe_values,
component);
symmetric_second_order_tensors.resize(n_symmetric_second_order_tensors);
for (unsigned int component = 0; component < n_symmetric_second_order_tensors; ++component)
{
+#ifndef DEAL_II_EXPLICIT_DESTRUCTOR_BUG
+ symmetric_second_order_tensors[component]
+ .dealii::FEValuesViews::SymmetricTensor<2, dim, spacedim>::~SymmetricTensor();
+#else
typedef dealii::FEValuesViews::SymmetricTensor<2, dim, spacedim> SymmetricTensorView;
symmetric_second_order_tensors[component].SymmetricTensorView::~SymmetricTensor();
+#endif
new (&symmetric_second_order_tensors[component])
dealii::FEValuesViews::SymmetricTensor<2, dim, spacedim > (fe_values,
component);