From: Doğukan Korkmaztürk Date: Sat, 31 Aug 2019 01:18:18 +0000 (-0400) Subject: stats: Catch exceptions by const reference X-Git-Tag: v19.0.0.0~605 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=633638ae5dc6f057938bc11337f52c3f047c0d79;p=gem5.git stats: Catch exceptions by const reference 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 Reviewed-by: Andreas Sandberg Maintainer: Jason Lowe-Power Maintainer: Andreas Sandberg Tested-by: kokoro --- diff --git a/src/base/stats/hdf5.cc b/src/base/stats/hdf5.cc index bb3705c3b..1e11d5627 100644 --- a/src/base/stats/hdf5.cc +++ b/src/base/stats/hdf5.cc @@ -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); }