Make Matcher subclasses final

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();
This commit is contained in:
Rebecca Turner 2024-03-09 17:07:52 -08:00
parent 3120fef01b
commit 70e93c1e2b
No known key found for this signature in database

View file

@ -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;
@ -504,7 +504,7 @@ struct RegexMatcher : public Matcher
}
};
struct StorePathMatcher : public Matcher
struct StorePathMatcher final : public Matcher
{
nix::StorePath storePath;
@ -522,7 +522,7 @@ struct StorePathMatcher : public Matcher
}
};
struct NameMatcher : public Matcher
struct NameMatcher final : public Matcher
{
std::string name;
@ -540,7 +540,7 @@ struct NameMatcher : public Matcher
}
};
struct AllMatcher : public Matcher
struct AllMatcher final : public Matcher
{
std::string getTitle() override
{