From 9a5ca802c711fe0e233d78fd51474e8040338d2e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 22 Jan 2020 21:26:19 +0100 Subject: [PATCH] clang fixes https://hydra.nixos.org/build/110757171 --- src/libstore/fetchers/fetchers.hh | 4 ++++ src/libstore/fetchers/git.cc | 5 +++-- src/libstore/fetchers/mercurial.cc | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libstore/fetchers/fetchers.hh b/src/libstore/fetchers/fetchers.hh index b59b328cc..1f3be8c2b 100644 --- a/src/libstore/fetchers/fetchers.hh +++ b/src/libstore/fetchers/fetchers.hh @@ -27,6 +27,8 @@ struct Input : std::enable_shared_from_this std::string type; std::optional narHash; + virtual ~Input() { } + virtual bool operator ==(const Input & other) const { return false; } virtual bool isDirect() const { return true; } @@ -63,6 +65,8 @@ struct ParsedURL; struct InputScheme { + virtual ~InputScheme() { } + virtual std::unique_ptr inputFromURL(const ParsedURL & url) = 0; }; diff --git a/src/libstore/fetchers/git.cc b/src/libstore/fetchers/git.cc index bfa862cf5..16bbcd285 100644 --- a/src/libstore/fetchers/git.cc +++ b/src/libstore/fetchers/git.cc @@ -142,7 +142,7 @@ struct GitInput : Input return res; } - std::optional getSourcePath() const + std::optional getSourcePath() const override { if (url.scheme == "git+file" && !ref && !rev) return url.path; @@ -172,7 +172,8 @@ struct GitInput : Input return {std::move(*tree), input}; } - auto [isLocal, actualUrl] = getActualUrl(); + auto [isLocal, actualUrl_] = getActualUrl(); + auto actualUrl = actualUrl_; // work around clang bug // If this is a local directory and no ref or revision is // given, then allow the use of an unclean working tree. diff --git a/src/libstore/fetchers/mercurial.cc b/src/libstore/fetchers/mercurial.cc index 64d5e84e1..304b2d967 100644 --- a/src/libstore/fetchers/mercurial.cc +++ b/src/libstore/fetchers/mercurial.cc @@ -84,7 +84,8 @@ struct MercurialInput : Input auto input = std::make_shared(*this); - auto [isLocal, actualUrl] = getActualUrl(); + auto [isLocal, actualUrl_] = getActualUrl(); + auto actualUrl = actualUrl_; // work around clang bug // FIXME: return lastModified.