]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
When reading the C++ standard 12.4 I'm not quite sure whether this is a bug
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 7 Aug 2013 09:03:04 +0000 (09:03 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 7 Aug 2013 09:03:04 +0000 (09:03 +0000)
or not.

But anyway, simplifying the destructor call resolves this issue, so there
is no need for a guard and an expensive configure test.

git-svn-id: https://svn.dealii.org/branches/branch_port_to_libcxx@30241 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/checks/check_03_compiler_bugs.cmake
deal.II/include/deal.II/base/config.h.in
deal.II/source/fe/fe_values.cc

index cf49fb0e579e65cc7a008799f60092e9117c96db..bb63ba07404e9665c70b92fcfea422859832ef65 100644 (file)
 ########################################################################
 
 
-#
-# Some compiler versions, notably ICC, have trouble with the
-# following code in which we explicitly call a destructor.
-# This has to be worked around with a typedef. The problem is
-# that the workaround fails with some other compilers, so that
-# we can not unconditionally use the workaround...
-#
-# - Wolfgang Bangerth, Matthias Maier, rewritten 2012
-#
-CHECK_CXX_COMPILER_BUG(
-  "
-  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; }
-  "
-  DEAL_II_EXPLICIT_DESTRUCTOR_BUG
-  )
-
-
 #
 # On some gcc 4.3 snapshots, a 'const' qualifier on a return type triggers a
 # warning. This is unfortunate, since we happen to stumble on this
index c0791a0430cabfdbfc186d9cb38ecf91a8b7f1f7..ca90c59df9e9c6414c01e9a6649a3dfa11151ca4 100644 (file)
  * Configured in check_2_compiler_bugs: *
  ****************************************/
 
-/* Defined 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.
- */
-#cmakedefine DEAL_II_EXPLICIT_DESTRUCTOR_BUG
-
 /* Defined if we have to work around a bug with some compilers that will not
  * allow us to specify a fully specialized class of a template as a friend.
  * See the aclocal.m4 file in the top-level directory for a description of
index 0602d5fd09a3a076ebc6cdb71c99a8aa0925bde4..9b63f27839c61a309d21a09495345fe494003062 100644 (file)
@@ -1641,12 +1641,7 @@ namespace internal
       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::~ScalarView ();
-#endif
+          scalars[component].~Scalar();
           new (&scalars[component])
           dealii::FEValuesViews::Scalar<dim,spacedim>(fe_values,
                                                       component);
@@ -1665,12 +1660,7 @@ namespace internal
       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::~VectorView ();
-#endif
+          vectors[component].~Vector ();
           new (&vectors[component])
           dealii::FEValuesViews::Vector<dim,spacedim>(fe_values,
                                                       component);
@@ -1685,13 +1675,8 @@ namespace internal
       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::~SymmetricTensorView();
-#endif
+          symmetric_second_order_tensors[component].~SymmetricTensor();
+
           new (&symmetric_second_order_tensors[component])
           dealii::FEValuesViews::SymmetricTensor<2, dim, spacedim > (fe_values,
                                                                      component);
@@ -1707,13 +1692,8 @@ namespace internal
       second_order_tensors.resize(n_second_order_tensors);
       for (unsigned int component = 0; component < n_second_order_tensors; ++component)
         {
-#ifndef DEAL_II_EXPLICIT_DESTRUCTOR_BUG
-          second_order_tensors[component]
-          .dealii::FEValuesViews::Tensor<2, dim, spacedim>::~Tensor();
-#else
-          typedef dealii::FEValuesViews::Tensor<2, dim, spacedim> TensorView;
-          second_order_tensors[component].TensorView::~TensorView();
-#endif
+          second_order_tensors[component].~Tensor();
+
           new (&second_order_tensors[component])
           dealii::FEValuesViews::Tensor<2, dim, spacedim > (fe_values,
                                                             component);

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.