diff options
author | Rosen Penev <rosenp@gmail.com> | 2020-03-11 23:43:06 -0700 |
---|---|---|
committer | Rosen Penev <rosenp@gmail.com> | 2020-03-12 12:59:16 -0700 |
commit | f00f8b002ae3a1b716eec30368aecf2438870d64 (patch) | |
tree | 4878729e5e33c7d0f0d5b2cafc9a08e57dde6878 /src/neighbor | |
parent | 2229e866730646cbc8334c598d3b6651ade4cf3e (diff) |
[clang-tidy] use nodiscard
Introduced in C++17. It replaces gcc's warn_unused_result.
Found with modernize-use-nodiscard.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src/neighbor')
-rw-r--r-- | src/neighbor/plugins/SmbclientNeighborPlugin.cxx | 2 | ||||
-rw-r--r-- | src/neighbor/plugins/UpnpNeighborPlugin.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx index 2a481770a..0f6812ff8 100644 --- a/src/neighbor/plugins/SmbclientNeighborPlugin.cxx +++ b/src/neighbor/plugins/SmbclientNeighborPlugin.cxx @@ -50,7 +50,7 @@ class SmbclientNeighborExplorer final : public NeighborExplorer { return name == other.name; } - gcc_pure + [[nodiscard]] gcc_pure NeighborInfo Export() const noexcept { return { "smb://" + name + "/", comment }; } diff --git a/src/neighbor/plugins/UpnpNeighborPlugin.cxx b/src/neighbor/plugins/UpnpNeighborPlugin.cxx index 1745acbed..e04f5011a 100644 --- a/src/neighbor/plugins/UpnpNeighborPlugin.cxx +++ b/src/neighbor/plugins/UpnpNeighborPlugin.cxx @@ -44,7 +44,7 @@ class UpnpNeighborExplorer final return name == other.name; } - gcc_pure + [[nodiscard]] gcc_pure NeighborInfo Export() const noexcept { return { "smb://" + name + "/", comment }; } @@ -62,7 +62,7 @@ public: /* virtual methods from class NeighborExplorer */ void Open() override; void Close() noexcept override; - List GetList() const noexcept override; + [[nodiscard]] List GetList() const noexcept override; private: /* virtual methods from class UPnPDiscoveryListener */ |