Avoid -Wcatch-value warning in testsuite
authorJonathan Wakely <jwakely@redhat.com>
Tue, 23 Apr 2019 23:17:52 +0000 (00:17 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 23 Apr 2019 23:17:52 +0000 (00:17 +0100)
* testsuite/20_util/variant/run.cc: Catch exception by reference to
prevent -Wcatch-value warning.

From-SVN: r270527

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/variant/run.cc

index 0d573fbe88a0faab457f302bf1196235b359ce8d..5b4d39cd5c8ed79c1e097429117837e6b678c6aa 100644 (file)
@@ -1,5 +1,8 @@
 2019-04-24  Jonathan Wakely  <jwakely@redhat.com>
 
+       * 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<false, Types...>::_Move_ctor_base(_Move_ctor_base&&)):
index ec1e86805cda636c7b5d6b665765a8ddadeb432b..f7353ad96b6d1477dfcffc48d50d1eb7af45beea 100644 (file)
@@ -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());
   }