This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Fix std::variant regression caused by never-valueless optimization
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Cc: Ville Voutilainen <ville dot voutilainen at gmail dot com>, Antony Polukhin <antoshkka at gmail dot com>
- Date: Wed, 24 Apr 2019 00:17:51 +0100
- Subject: Re: [PATCH] Fix std::variant regression caused by never-valueless optimization
- References: <20190423095637.GA15439@redhat.com>
On 23/04/19 10:56 +0100, Jonathan Wakely wrote:
+ } catch (__gnu_cxx::forced_error) {
This triggers a warning if compiled with -Wcatch-value.
Fixed by this patch, committed to trunk.
commit 72ffe1dada2f747fec7b9949835c0dcbe86d892f
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed Apr 24 00:15:56 2019 +0100
Avoid -Wcatch-value warning in testsuite
* testsuite/20_util/variant/run.cc: Catch exception by reference to
prevent -Wcatch-value warning.
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());
}