Merge pull request #8898 from edolstra/fix-catch-polymorphic-by-value

Fix warning 'catching polymorphic type by value'
This commit is contained in:
Eelco Dolstra 2023-09-01 15:33:56 +02:00 committed by GitHub
commit 4a8c9bb9aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -96,7 +96,7 @@ void CreateDerivationAndRealiseGoal::getDerivation()
auto drvPath = StorePath::dummy; auto drvPath = StorePath::dummy;
try { try {
drvPath = resolveDerivedPath(worker.store, *drvReq); drvPath = resolveDerivedPath(worker.store, *drvReq);
} catch (MissingRealisation) { } catch (MissingRealisation &) {
return std::nullopt; return std::nullopt;
} }
return worker.evalStore.isValidPath(drvPath) || worker.store.isValidPath(drvPath) return worker.evalStore.isValidPath(drvPath) || worker.store.isValidPath(drvPath)

View file

@ -60,7 +60,7 @@ void initLibUtil() {
bool caught = false; bool caught = false;
try { try {
throwExceptionSelfCheck(); throwExceptionSelfCheck();
} catch (nix::Error _e) { } catch (const nix::Error & _e) {
caught = true; caught = true;
} }
// This is not actually the main point of this check, but let's make sure anyway: // This is not actually the main point of this check, but let's make sure anyway: