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.