stats: Catch exceptions by const reference
authorDoğukan Korkmaztürk <d.korkmazturk@gmail.com>
Sat, 31 Aug 2019 01:18:18 +0000 (21:18 -0400)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Mon, 2 Sep 2019 09:55:11 +0000 (09:55 +0000)
Catching exceptions by value causes -Werror=catch-value= to be
triggered during a build process. This change replaces the values
with const references in the catch blocks.

Change-Id: Iddabb595c5916d8120dcdb08e2c2f36ff21c3c9b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20528
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/base/stats/hdf5.cc

index bb3705c3bd0985860ae2902336c559de565daf63..1e11d56278cf5f97355dcfd07b11fda37ce53281 100644 (file)
@@ -109,9 +109,9 @@ Hdf5::beginGroup(const char *name)
     H5::Group group;
     try {
         group = base.openGroup(name);
-    } catch (H5::FileIException e) {
+    } catch (const H5::FileIException& e) {
         group = base.createGroup(name);
-    } catch (H5::GroupIException e) {
+    } catch (const H5::GroupIException& e) {
         group = base.createGroup(name);
     }