From 313106d5491c7c6279f3c962348462ca04cd2e0e Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <edolstra@gmail.com>
Date: Tue, 26 Nov 2019 21:07:44 +0100
Subject: [PATCH] Fix clang warnings

---
 src/libstore/nar-info-disk-cache.hh | 2 ++
 src/libstore/remote-store.hh        | 2 +-
 src/libstore/ssh-store.cc           | 2 +-
 src/libstore/store-api.cc           | 2 +-
 src/nix/command.hh                  | 3 +++
 5 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/libstore/nar-info-disk-cache.hh b/src/libstore/nar-info-disk-cache.hh
index 11e6c55ca..285873f7e 100644
--- a/src/libstore/nar-info-disk-cache.hh
+++ b/src/libstore/nar-info-disk-cache.hh
@@ -10,6 +10,8 @@ class NarInfoDiskCache
 public:
     typedef enum { oValid, oInvalid, oUnknown } Outcome;
 
+    virtual ~NarInfoDiskCache() { };
+
     virtual void createCache(const std::string & uri, const Path & storeDir,
         bool wantMassQuery, int priority) = 0;
 
diff --git a/src/libstore/remote-store.hh b/src/libstore/remote-store.hh
index 84de4c460..728df8b00 100644
--- a/src/libstore/remote-store.hh
+++ b/src/libstore/remote-store.hh
@@ -148,7 +148,7 @@ public:
 
     std::string getUri() override;
 
-    bool sameMachine()
+    bool sameMachine() override
     { return true; }
 
 private:
diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc
index 93e117389..b9d0c41ea 100644
--- a/src/libstore/ssh-store.cc
+++ b/src/libstore/ssh-store.cc
@@ -35,7 +35,7 @@ public:
         return uriScheme + host;
     }
 
-    bool sameMachine()
+    bool sameMachine() override
     { return false; }
 
     void narFromPath(const Path & path, Sink & sink) override;
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 0758907e7..7e548ecd2 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -216,7 +216,7 @@ static std::string makeType(string && type, const PathSet & references)
         type += ":";
         type += i;
     }
-    return type;
+    return std::move(type);
 }
 
 
diff --git a/src/nix/command.hh b/src/nix/command.hh
index 26c15e646..2db22dba2 100644
--- a/src/nix/command.hh
+++ b/src/nix/command.hh
@@ -16,6 +16,7 @@ struct Pos;
    run() method. */
 struct Command : virtual Args
 {
+    virtual ~Command() { }
     virtual std::string name() = 0;
     virtual void prepare() { };
     virtual void run() = 0;
@@ -58,6 +59,8 @@ typedef std::vector<Buildable> Buildables;
 
 struct Installable
 {
+    virtual ~Installable() { }
+
     virtual std::string what() = 0;
 
     virtual Buildables toBuildables()
-- 
GitLab