aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-01-22 21:26:19 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-01-22 21:26:19 +0100
commit9a5ca802c711fe0e233d78fd51474e8040338d2e (patch)
treebfeda607ad93039e0a8a6c1f639fb80caca56a46 /src
parent872a22fa2344bdb95e0697bca168d6798d60ff5d (diff)
clang fixes
https://hydra.nixos.org/build/110757171
Diffstat (limited to 'src')
-rw-r--r--src/libstore/fetchers/fetchers.hh4
-rw-r--r--src/libstore/fetchers/git.cc5
-rw-r--r--src/libstore/fetchers/mercurial.cc3
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<Input>
std::string type;
std::optional<Hash> 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<Input> 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<Path> getSourcePath() const
+ std::optional<Path> 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<MercurialInput>(*this);
- auto [isLocal, actualUrl] = getActualUrl();
+ auto [isLocal, actualUrl_] = getActualUrl();
+ auto actualUrl = actualUrl_; // work around clang bug
// FIXME: return lastModified.