Skip to content

Commit

Permalink
Make Matcher subclasses final
Browse files Browse the repository at this point in the history
Fixes this very long warning, which I'll only include the first line of:

/nix/store/8wrjhrycpshhc3b41xmjwvgqr2m3yajq-libcxx-16.0.6-dev/include/c++/v1/__memory/construct_at.h:66:5: warning: destructor called on non-final 'RegexMatcher' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
    __loc->~_Tp();
  • Loading branch information
9999years committed Mar 10, 2024
1 parent 3120fef commit 70e93c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nix/profile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ struct Matcher
virtual bool matches(const std::string & name, const ProfileElement & element) = 0;
};

struct RegexMatcher : public Matcher
struct RegexMatcher final : public Matcher
{
std::regex regex;
std::string pattern;
Expand All @@ -504,7 +504,7 @@ struct RegexMatcher : public Matcher
}
};

struct StorePathMatcher : public Matcher
struct StorePathMatcher final : public Matcher
{
nix::StorePath storePath;

Expand All @@ -522,7 +522,7 @@ struct StorePathMatcher : public Matcher
}
};

struct NameMatcher : public Matcher
struct NameMatcher final : public Matcher
{
std::string name;

Expand All @@ -540,7 +540,7 @@ struct NameMatcher : public Matcher
}
};

struct AllMatcher : public Matcher
struct AllMatcher final : public Matcher
{
std::string getTitle() override
{
Expand Down

0 comments on commit 70e93c1

Please sign in to comment.