From 4e1407412b8d36b04ed50c5f09bb25fdf801e969 Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Tue, 11 Dec 2018 11:52:42 +0100 Subject: [PATCH] AthContainersCaloIdentifier: Fix gcc9 warnings. In C++11, implicit declarations of copy and assignment are deprecated if the class has a user defined destructor or copy or assignment. gcc9 now warns about this by default. Adjust to avoid the warning. --- Control/AthContainers/AthContainers/ViewVectorBase.h | 4 ++-- .../AthContainers/AthContainers/ViewVectorBase.icc | 11 +---------- Control/AthContainers/test/DataVector_test.cxx | 4 ++-- Control/AthContainers/test/DataVector_test.icc | 7 +++++-- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Control/AthContainers/AthContainers/ViewVectorBase.h b/Control/AthContainers/AthContainers/ViewVectorBase.h index 1a48f56a737..6dfa370d768 100644 --- a/Control/AthContainers/AthContainers/ViewVectorBase.h +++ b/Control/AthContainers/AthContainers/ViewVectorBase.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -38,7 +38,7 @@ class ViewVectorBase { public: /// Destructor. - virtual ~ViewVectorBase(); + virtual ~ViewVectorBase() = default; /** diff --git a/Control/AthContainers/AthContainers/ViewVectorBase.icc b/Control/AthContainers/AthContainers/ViewVectorBase.icc index bd003c1b813..bcd0da245d6 100644 --- a/Control/AthContainers/AthContainers/ViewVectorBase.icc +++ b/Control/AthContainers/AthContainers/ViewVectorBase.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -52,15 +52,6 @@ SG::AuxVectorData* getContainer (T* p) namespace SG { -/** - * @brief Destructor. - */ -inline -ViewVectorBase::~ViewVectorBase() -{ -} - - /** * @brief Clear the persistent data. */ diff --git a/Control/AthContainers/test/DataVector_test.cxx b/Control/AthContainers/test/DataVector_test.cxx index 1e1d7daf6bd..e7267bcd32a 100644 --- a/Control/AthContainers/test/DataVector_test.cxx +++ b/Control/AthContainers/test/DataVector_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ @@ -77,7 +77,7 @@ class FluffContainer : public DataVector<DerivedFluff> { public: FluffContainer() : DataVector<DerivedFluff>() { }; - virtual ~FluffContainer() {} + virtual ~FluffContainer() = default; }; diff --git a/Control/AthContainers/test/DataVector_test.icc b/Control/AthContainers/test/DataVector_test.icc index e21548e5a33..369864ac28a 100644 --- a/Control/AthContainers/test/DataVector_test.icc +++ b/Control/AthContainers/test/DataVector_test.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -117,6 +117,8 @@ void check_dtor_log(int a=-1,int b=-1,int c=-1,int d=-1, int e=-1, int f=-1) struct AA { AA (int the_x=0): x(the_x) {} + AA (const AA&) = default; + AA& operator= (const AA&) = default; ~AA() { dtor_log.push_back (x); } int x; bool operator< (const AA& other) const { return x < other.x; } @@ -198,7 +200,8 @@ CLASS_DEF( DataVector<Q> , 9886 , 1 ) struct AAux : public SG::AuxElement { AAux (int the_x=0) : x(the_x) { } - //AAux (const AAux& other) : SG::AuxElement(other), x(other.x) {} + AAux (const AAux& other) = default; + AAux& operator= (const AAux& other) = default; virtual ~AAux() { dtor_log.push_back (x); } int x; bool operator< (const AAux& other) const { return x < other.x; } -- GitLab