From a24a0e1062c7e81dee9cb334d13e22efaf02058d Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 3 Nov 2021 13:59:05 -0400
Subject: [PATCH] RootUtils: Update for thread-safety checker const changes.

The thread-safety checker is getting more strict on const checks.
Fix resulting warnings.
---
 Control/RootUtils/src/Type.cxx | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/Control/RootUtils/src/Type.cxx b/Control/RootUtils/src/Type.cxx
index 6282f08171f..77b963e3f86 100644
--- a/Control/RootUtils/src/Type.cxx
+++ b/Control/RootUtils/src/Type.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file RootUtils/src/Type.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -12,6 +10,7 @@
 
 
 #include "RootUtils/Type.h"
+#include "CxxUtils/checker_macros.h"
 #include "TError.h"
 #include "TROOT.h"
 #include <memory>
@@ -303,8 +302,13 @@ void* Type::create() const
 void Type::destroy (void* p) const
 {
   if (p) {
-    if (m_cls)
-      m_cls->Destructor (p);
+    if (m_cls) {
+      // TClass::Destructor is non-const.
+      // But there's nothing obviously problematic in it...
+      // just suppress the checker warning for now.
+      TClass* cls ATLAS_THREAD_SAFE = m_cls;
+      cls->Destructor (p);
+    }
     else
       delete [] (reinterpret_cast<char*> (p));
   }
-- 
GitLab