ENDIF()
-#
-# Intel (at least 14, 15) has a bug where it incorrectly detects multiple
-# matching function candidates and dies during type resolution in a
-# perfectly valid SFINAE scenario. This seems to happen because the templated
-# variant is not discarded (where it should be):
-#
-# error: more than one instance of overloaded function
-# "has_vmult_add<Range, T>::test [with Range=double, T=MyMatrix]"
-# matches the argument list:
-# function template "void has_vmult_add<Range, T>::test<C>(decltype((<expression>))) [with Range=double, T=MyMatrix]"
-# function template "void has_vmult_add<Range, T>::test<C>(decltype((&C::vmult_add<double>))) [with Range=double, T=MyMatrix]"
-# [...]
-#
-# - Matthias Maier, 2015
-#
-
-IF(DEAL_II_WITH_CXX11)
- PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
- CHECK_CXX_COMPILER_BUG(
- "
- template <typename Range, typename T> struct has_vmult_add
- {
- template <typename C>
- static void test(decltype(&C::vmult_add));
-
- template <typename C>
- static void test(decltype(&C::template vmult_add<Range>));
-
- typedef decltype(test<T>(0)) type;
- };
-
- struct MyMatrix
- {
- void vmult_add() const;
- };
-
- int main()
- {
- typedef has_vmult_add<double, MyMatrix>::type test;
- }
- "
- DEAL_II_ICC_SFINAE_BUG
- )
- RESET_CMAKE_REQUIRED()
-ENDIF()
-
#
# Intel 16.0.1 produces wrong code that creates a race condition in
# tests/fe/curl_curl_01.debug but 16.0.2 is known to work. Blacklist this
<h3>Specific improvements</h3>
<ol>
+ <li> Improved: The trait class has_vmult_add in linear_operators.h
+ has been restricted to test if there is a vmult_add and a Tvmult_add
+ method that takes two arguments. This check now also works with
+ ICC 13 and ICC 14.
+ <br>
+ (Daniel Arndt, 2016/11/25)
+ </li>
+
<li> Fixed: DataOut::build_patches() ignored a higher order
or Eulerian mapping if no data had previously been attached
via DataOut::add_data_vector(), i.e., if all that was to be output
#cmakedefine DEAL_II_BOOST_BIND_COMPILER_BUG
#cmakedefine DEAL_II_BIND_NO_CONST_OP_PARENTHESES
#cmakedefine DEAL_II_CONSTEXPR_BUG
-#cmakedefine DEAL_II_ICC_SFINAE_BUG
/***********************************************************************
namespace
{
// A trait class that determines whether type T provides public
- // (templated or non-templated) vmult_add and Tvmult_add member functions
+ // (templated or non-templated) vmult_add member functions
template <typename Range, typename Domain, typename T>
- class has_vmult_add
+ class has_vmult_add_and_Tvmult_add
{
template <typename C>
static std::false_type test(...);
template <typename C>
- static std::true_type test(decltype(&C::vmult_add),
- decltype(&C::Tvmult_add));
-
- // Work around a bug with icc (up to version 15) that fails during type
- // deduction in an SFINAE scenario
-#ifndef DEAL_II_ICC_SFINAE_BUG
-
- template <typename C>
- static std::true_type test(decltype(&C::template vmult_add<Range>),
- decltype(&C::template Tvmult_add<Range>));
-
- template <typename C>
- static std::true_type test(decltype(&C::template vmult_add<Range, Domain>),
- decltype(&C::template Tvmult_add<Domain, Range>));
-#endif
+ static auto test(Range *r, Domain *d)
+ -> decltype(std::declval<C>().vmult_add(*r,*d),
+ std::declval<C>().Tvmult_add(*d,*r),
+ std::true_type());
public:
// type is std::true_type if Matrix provides vmult_add and Tvmult_add,
// otherwise it is std::false_type
- typedef decltype(test<T>(0, 0)) type;
+ typedef decltype(test<T>(nullptr, nullptr)) type;
};
};
typename std::conditional<
- has_vmult_add<Range, Domain, Matrix>::type::value,
- MatrixInterfaceWithVmultAdd<Range, Domain>,
- MatrixInterfaceWithoutVmultAdd<Range, Domain>>::type().
- operator()(return_op, matrix);
+ has_vmult_add_and_Tvmult_add<Range, Domain, Matrix>::type::value,
+ MatrixInterfaceWithVmultAdd<Range, Domain>,
+ MatrixInterfaceWithoutVmultAdd<Range, Domain>>::type().
+ operator()(return_op, matrix);
return return_op;
}
{
deallog << "MyMatrix6::vmult_add" << std::endl;
}
-
- template<typename number, typename number2>
- void Tvmult_add(Vector<number> &, const Vector<number2> &, bool = true) const
- {
- deallog << "MyMatrix6::Tvmult_add" << std::endl;
- }
};
using namespace dealii;
linear_operator(m2).vmult_add(v, u);
linear_operator(m2).Tvmult_add(v, u);
-#ifndef DEAL_II_ICC_SFINAE_BUG
-
linear_operator(m3).vmult(v, u);
linear_operator(m3).Tvmult(v, u);
linear_operator(m3).vmult_add(v, u);
linear_operator(m6).Tvmult(v, u);
linear_operator(m6).vmult_add(v, u);
linear_operator(m6).Tvmult_add(v, u);
-
-#else
-
- deallog << "MyMatrix3::vmult" << std::endl;
- deallog << "MyMatrix3::Tvmult" << std::endl;
- deallog << "MyMatrix3::vmult_add" << std::endl;
- deallog << "MyMatrix3::Tvmult_add" << std::endl;
-
- deallog << "MyMatrix4::vmult" << std::endl;
- deallog << "MyMatrix4::Tvmult" << std::endl;
- deallog << "MyMatrix4::vmult_add" << std::endl;
- deallog << "MyMatrix4::Tvmult_add" << std::endl;
-
- deallog << "MyMatrix5::vmult" << std::endl;
- deallog << "MyMatrix5::Tvmult" << std::endl;
- deallog << "MyMatrix5::vmult_add" << std::endl;
- deallog << "MyMatrix5::Tvmult_add" << std::endl;
-
- deallog << "MyMatrix6::vmult" << std::endl;
- deallog << "MyMatrix6::Tvmult" << std::endl;
- deallog << "MyMatrix6::vmult_add" << std::endl;
- deallog << "MyMatrix6::Tvmult_add" << std::endl;
-
-#endif
}
DEAL::MyMatrix5::Tvmult_add
DEAL::MyMatrix6::vmult
DEAL::MyMatrix6::Tvmult
-DEAL::MyMatrix6::vmult_add
-DEAL::MyMatrix6::Tvmult_add
+DEAL::MyMatrix6::vmult
+DEAL::MyMatrix6::Tvmult