aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-09-01 15:33:56 +0200
committerGitHub <noreply@github.com>2023-09-01 15:33:56 +0200
commit4a8c9bb9aa872d0f20c5aeb62357f832b4f9c0b4 (patch)
tree618b84a1fc90251ddea736d6c3441fd5acd2f852
parent3420b60b3995b1d26da67540950c511ccd5d5996 (diff)
parent5c95b32c461da645826ff6bf248183f066c57b20 (diff)
Merge pull request #8898 from edolstra/fix-catch-polymorphic-by-value
Fix warning 'catching polymorphic type by value'
-rw-r--r--src/libstore/build/create-derivation-and-realise-goal.cc2
-rw-r--r--src/libutil/util.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/build/create-derivation-and-realise-goal.cc b/src/libstore/build/create-derivation-and-realise-goal.cc
index b01042f00..60f67956d 100644
--- a/src/libstore/build/create-derivation-and-realise-goal.cc
+++ b/src/libstore/build/create-derivation-and-realise-goal.cc
@@ -96,7 +96,7 @@ void CreateDerivationAndRealiseGoal::getDerivation()
auto drvPath = StorePath::dummy;
try {
drvPath = resolveDerivedPath(worker.store, *drvReq);
- } catch (MissingRealisation) {
+ } catch (MissingRealisation &) {
return std::nullopt;
}
return worker.evalStore.isValidPath(drvPath) || worker.store.isValidPath(drvPath)
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index f24a6e165..5a10c69e2 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -60,7 +60,7 @@ void initLibUtil() {
bool caught = false;
try {
throwExceptionSelfCheck();
- } catch (nix::Error _e) {
+ } catch (const nix::Error & _e) {
caught = true;
}
// This is not actually the main point of this check, but let's make sure anyway: