From e0657c24aed69bc9f6030823d28bcb1e8b93426c Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 24 Apr 2019 00:17:52 +0100 Subject: [PATCH] Avoid -Wcatch-value warning in testsuite * testsuite/20_util/variant/run.cc: Catch exception by reference to prevent -Wcatch-value warning. From-SVN: r270527 --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/testsuite/20_util/variant/run.cc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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()); } -- 2.30.2