########################################################################
-#
-# 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
* 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
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);
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);
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);
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);