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 <jwak...@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());
   }

Reply via email to