I get the following error when trying to compile the program below. What should be modified to be able to compile? Looks like GCC 4.9.2 can't implement some noexcept move constructors as "=default".
The line 7 is causing trouble: TabStats::TabStats(TabStats&& other) noexcept = default;
COMPILATION ERROR: /resource_coordinator/tab_stats.cc:14:1: error: function 'resource_coordinator::TabStats::TabStats(resource_coordinator::TabStats&&)' defaulted on its redeclaration with an exception-specification that differs from the implicit declaration 'resource_coordinator::TabStats::TabStats(resource_coordinator::TabStats&&)' TabStats::TabStats(TabStats&& other) noexcept = default;
^
SOURCE CODE:
#include "browser/resource_coordinator/tab_stats.h"
#include "build/build_config.h"
namespace resource_coordinator {
TabStats::TabStats() = default;
TabStats::TabStats(const TabStats& other) = default;
TabStats::TabStats(TabStats&& other) noexcept = default;
TabStats::~TabStats() {}
TabStats& TabStats::operator=(const TabStats& other) = default;
} // namespace resource_coordinator
tab_stats.h is included below:
#ifndef BROWSER_RESOURCE_COORDINATOR_TAB_STATS_H_
#define BROWSER_RESOURCE_COORDINATOR_TAB_STATS_H_
#include <stdint.h>
#include <vector>
#include "base/process/process.h"
#include "base/strings/string16.h"
#include "base/time/time.h"
#include "build/build_config.h"
namespace content {
class RenderProcessHost;
} // namespace content
namespace resource_coordinator {
struct TabStats {
TabStats();
TabStats(const TabStats& other);
TabStats(TabStats&& other) noexcept;
~TabStats();
TabStats& operator=(const TabStats& other);
bool is_app = false; // Browser window is an app.
bool is_internal_page = false; // Internal page, such as NTP or Settings.
// Playing audio, accessing cam/mic or mirroring display.
bool is_media = false;
bool is_pinned = false;
bool is_in_visible_window = false;
bool is_in_active_window = false;
// Whether this is the active tab in a browser window.
bool is_active = false;
bool is_discarded = false;
// User has entered text in a form.
bool has_form_entry = false;
int discard_count = 0;
bool has_beforeunload_handler = false;
base::TimeTicks last_active;
base::TimeTicks last_hidden;
content::RenderProcessHost* render_process_host = nullptr;
base::ProcessHandle renderer_handle = 0;
int child_process_host_id = 0;
base::string16 title;
#if defined(OS_CHROMEOS)
int oom_score = 0;
#endif
int64_t tab_contents_id = 0; // Unique ID per WebContents.
bool is_auto_discardable = true;
};
typedef std::vector<TabStats> TabStatsList;
} // namespace resource_coordinator
#endif // BROWSER_RESOURCE_COORDINATOR_TAB_STATS_H_