Skip to content

Commit

Permalink
Reverted the previous change regarding warnings aboit slicing excepti…
Browse files Browse the repository at this point in the history
…ons.

Apparently, slicing was intentional, and the test verified that it worked.
This commit restores the previous behavior and disables the gcc warning
instead.
  • Loading branch information
Lastique committed Nov 24, 2018
1 parent 8e4a631 commit 5a70ced
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions test/operations_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ namespace

// exception_tests() ---------------------------------------------------------------//

#if defined(BOOST_GCC) && BOOST_GCC >= 80000
#pragma GCC diagnostic push
// catching polymorphic type "X" by value - that's the intention of the test
#pragma GCC diagnostic ignored "-Wcatch-value"
#endif

void exception_tests()
{
cout << "exception_tests..." << endl;
Expand All @@ -304,7 +310,7 @@ namespace
{
fs::create_directory("no-such-dir/foo/bar");
}
catch (std::runtime_error& x)
catch (std::runtime_error x)
{
exception_thrown = true;
if (report_throws) cout << x.what() << endl;
Expand All @@ -325,7 +331,7 @@ namespace
{
fs::create_directory("no-such-dir/foo/bar");
}
catch (system_error& x)
catch (system_error x)
{
exception_thrown = true;
if (report_throws) cout << x.what() << endl;
Expand All @@ -343,7 +349,7 @@ namespace
{
fs::create_directory("no-such-dir/foo/bar");
}
catch (fs::filesystem_error& x)
catch (fs::filesystem_error x)
{
exception_thrown = true;
if (report_throws) cout << x.what() << endl;
Expand All @@ -368,7 +374,7 @@ namespace
{
fs::create_directory("no-such-dir/foo/bar");
}
catch (fs::filesystem_error& x)
catch (const fs::filesystem_error& x)
{
exception_thrown = true;
if (report_throws) cout << x.what() << endl;
Expand Down Expand Up @@ -407,6 +413,10 @@ namespace
cout << " exception_tests complete" << endl;
}

#if defined(BOOST_GCC) && BOOST_GCC >= 80000
#pragma GCC diagnostic pop
#endif

// create a directory tree that can be used by subsequent tests ---------------------//
//
// dir
Expand Down

0 comments on commit 5a70ced

Please sign in to comment.