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

do not catch polymorphic type `Dune::RangeError` by value

This addresses the following compiler warning from GCC 8:

    warning: catching polymorphic type ‘class Dune::RangeError’
    by value [-Wcatch-value=]
parent 2df1f68c
Branches
Tags
1 merge request!497address more gcc 8 warnings
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment