Skip to content
Snippets Groups Projects
Commit 7b2d907b authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

Merge branch 'feature/silence-more-gcc-8-warnings' into 'master'

address more gcc 8 warnings

See merge request !497
parents 2df1f68c 3091dfd1
No related branches found
No related tags found
1 merge request!497address more gcc 8 warnings
Pipeline #
......@@ -170,9 +170,20 @@ namespace Dune {
class = void_t<decltype(-std::declval<const U&>())> >
decltype(auto) operator-() const { return aligned<align>(-value_); }
/*
* silence warnings from GCC about using `~` on a bool
* (when instantiated for T=bool)
*/
#if __GNUC__ >= 7
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wbool-operation"
#endif
template<class U = T,
class = void_t<decltype(~std::declval<const U&>())> >
decltype(auto) operator~() const { return aligned<align>(~value_); }
#if __GNUC__ >= 7
# pragma GCC diagnostic pop
#endif
template<class U = T,
class = void_t<decltype(!std::declval<const U&>())> >
......
......@@ -12,6 +12,16 @@
namespace Dune {
/*
* silence warnings from GCC about using integer operands on a bool
* (when instantiated for T=bool)
*/
#if __GNUC__ >= 7
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wbool-operation"
# pragma GCC diagnostic ignored "-Wint-in-bool-context"
#endif
/**
* This class specifies a vector-like type deriving from std::array
* for memory management and basic accessibility.
......@@ -505,6 +515,10 @@ namespace Dune {
public std::integral_constant<bool, IsNumber<T>::value>{
};
#if __GNUC__ >= 7
# pragma GCC diagnostic pop
#endif
} //namespace Dune
#endif
......@@ -13,6 +13,16 @@
namespace Dune {
/*
* silence warnings from GCC about using integer operands on a bool
* (when instantiated for T=bool)
*/
#if __GNUC__ >= 7
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wbool-operation"
# pragma GCC diagnostic ignored "-Wint-in-bool-context"
#endif
//! Test suite for arithmetic types
/**
* You usually want to call the member function `checkArithmetic()`. The
......@@ -780,6 +790,10 @@ namespace Dune {
}
};
#if __GNUC__ >= 7
# pragma GCC diagnostic pop
#endif
} // namespace Dune
#endif // DUNE_COMMON_TEST_ARITHMETICTESTSUITE_HH
......@@ -244,7 +244,7 @@ bool run() {
std::cout << "(line " << __LINE__ << ") Error: No exception thrown."
<< std::endl;
passed = false;
} catch (Dune::RangeError) {
} catch (const Dune::RangeError&) {
std::cout << "(line " << __LINE__
<< ") All good: Exception thrown as expected." << std::endl;
}
......@@ -255,7 +255,7 @@ bool run() {
std::cout << "(line " << __LINE__ << ") Error: No exception thrown."
<< std::endl;
passed = false;
} catch (Dune::RangeError) {
} catch (const Dune::RangeError&) {
std::cout << "(line " << __LINE__
<< ") All good: Exception thrown as expected." << std::endl;
}
......@@ -266,7 +266,7 @@ bool run() {
std::cout << "(line " << __LINE__ << ") Error: No exception thrown."
<< std::endl;
passed = false;
} catch (Dune::RangeError) {
} catch (const Dune::RangeError&) {
std::cout << "(line " << __LINE__
<< ") All good: Exception thrown as expected." << std::endl;
}
......@@ -281,7 +281,7 @@ bool run() {
std::cout << "(line " << __LINE__ << ") Error: No exception thrown."
<< std::endl;
passed = false;
} catch (Dune::RangeError) {
} catch (const Dune::RangeError&) {
std::cout << "(line " << __LINE__
<< ") All good: Exception thrown as expected." << std::endl;
}
......@@ -295,7 +295,7 @@ bool run() {
std::cout << "(line " << __LINE__ << ") Error: No exception thrown."
<< std::endl;
passed = false;
} catch (Dune::RangeError) {
} catch (const Dune::RangeError&) {
std::cout << "(line " << __LINE__
<< ") All good: Exception thrown as expected." << std::endl;
}
......@@ -309,7 +309,7 @@ bool run() {
std::cout << "(line " << __LINE__ << ") Error: No exception thrown."
<< std::endl;
passed = false;
} catch (Dune::RangeError) {
} catch (const Dune::RangeError&) {
std::cout << "(line " << __LINE__
<< ") All good: Exception thrown as expected." << std::endl;
}
......@@ -342,7 +342,7 @@ bool run() {
std::cout << "(line " << __LINE__ << ") Error: No exception thrown."
<< std::endl;
passed = false;
} catch (Dune::RangeError) {
} catch (const Dune::RangeError&) {
std::cout << "(line " << __LINE__
<< ") All good: Exception thrown as expected." << std::endl;
}
......@@ -352,7 +352,7 @@ bool run() {
std::cout << "(line " << __LINE__ << ") Error: No exception thrown."
<< std::endl;
passed = false;
} catch (Dune::RangeError) {
} catch (const Dune::RangeError&) {
std::cout << "(line " << __LINE__
<< ") All good: Exception thrown as expected." << std::endl;
}
......@@ -362,7 +362,7 @@ bool run() {
std::cout << "(line " << __LINE__ << ") Error: No exception thrown."
<< std::endl;
passed = false;
} catch (Dune::RangeError) {
} catch (const Dune::RangeError&) {
std::cout << "(line " << __LINE__
<< ") All good: Exception thrown as expected." << std::endl;
}
......
......@@ -18,4 +18,4 @@ int init_Factory()
return 0;
}
static const int DUNE_UNUSED(init) = init_Factory();
static const int DUNE_UNUSED init = init_Factory();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment