From: Jonathan Wakely Date: Tue, 23 Apr 2019 23:17:52 +0000 (+0100) Subject: Avoid -Wcatch-value warning in testsuite X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e0657c24aed69bc9f6030823d28bcb1e8b93426c;p=gcc.git Avoid -Wcatch-value warning in testsuite * testsuite/20_util/variant/run.cc: Catch exception by reference to prevent -Wcatch-value warning. From-SVN: r270527 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0d573fbe88a..5b4d39cd5c8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2019-04-24 Jonathan Wakely + * testsuite/20_util/variant/run.cc: Catch exception by reference to + prevent -Wcatch-value warning. + * include/std/variant (__variant_construct): Use template parameter type instead of equivalent decltype-specifier. (_Move_ctor_base::_Move_ctor_base(_Move_ctor_base&&)): diff --git a/libstdc++-v3/testsuite/20_util/variant/run.cc b/libstdc++-v3/testsuite/20_util/variant/run.cc index ec1e86805cd..f7353ad96b6 100644 --- a/libstdc++-v3/testsuite/20_util/variant/run.cc +++ b/libstdc++-v3/testsuite/20_util/variant/run.cc @@ -286,7 +286,7 @@ void emplace() Vector::allocator_type::set_limit(0); vv.emplace<2>(1, 1); VERIFY(false); - } catch (__gnu_cxx::forced_error) { + } catch (const __gnu_cxx::forced_error&) { } VERIFY(vv.valueless_by_exception()); }