From dae3057f3cf22cb143dd8c40ce697a29e036c664 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 1 Dec 2020 15:24:37 -0500
Subject: [PATCH] AthAllocators: Fix gcc11 warning.

Check the result of dynamic_cast before dereferencing.
---
 .../AthAllocators/AthAllocators/ArenaHandleBaseAllocT.icc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Control/AthAllocators/AthAllocators/ArenaHandleBaseAllocT.icc b/Control/AthAllocators/AthAllocators/ArenaHandleBaseAllocT.icc
index d519412147c..1571929595e 100644
--- a/Control/AthAllocators/AthAllocators/ArenaHandleBaseAllocT.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaHandleBaseAllocT.icc
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id: ArenaHandleBaseAllocT.icc 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file  AthAllocators/ArenaHandleBaseAllocT.icc
  * @author scott snyder
@@ -107,7 +105,9 @@ template <typename ALLOC>
 const typename ALLOC::Params&
 ArenaHandleBaseAllocT<ALLOC>::params() const
 {
-  return dynamic_cast<const ALLOC*>(this->baseAllocator())->params();
+  const ALLOC* alloc = dynamic_cast<const ALLOC*>(this->baseAllocator());
+  if (!alloc) std::abort();
+  return alloc->params();
 }
 
 
-- 
GitLab