From 332baa4f67012babb04d1d72582f6d96c6713e8f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Feb 2017 10:13:58 +0100 Subject: [PATCH] DetachedSong: don't declare empty destructor An explicit destructor prevents usage of implicit move operators, even if it's empty. Therefore, declaring a defaulted destructor with GCC attribute "noinline" does what we want without preventing those implicit operators. --- src/DetachedSong.cxx | 5 ----- src/DetachedSong.hxx | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/DetachedSong.cxx b/src/DetachedSong.cxx index 4774cfd23..da5d0f629 100644 --- a/src/DetachedSong.cxx +++ b/src/DetachedSong.cxx @@ -31,11 +31,6 @@ DetachedSong::DetachedSong(const LightSong &other) start_time(other.start_time), end_time(other.end_time) {} -DetachedSong::~DetachedSong() -{ - /* this destructor exists here just so it won't inlined */ -} - bool DetachedSong::IsRemote() const { diff --git a/src/DetachedSong.hxx b/src/DetachedSong.hxx index 5840cd696..2197d0d43 100644 --- a/src/DetachedSong.hxx +++ b/src/DetachedSong.hxx @@ -98,7 +98,8 @@ public: */ explicit DetachedSong(const LightSong &other); - ~DetachedSong(); + gcc_noinline + ~DetachedSong() = default; /* these are declared because the user-defined destructor above prevents them from being generated implicitly */