From af47537ff05a905827f4d41a332231562c9020fd Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 29 Jul 2025 14:34:15 +0200 Subject: [PATCH 1/2] Deprecate operator-> for objects that are not pointers --- python/templates/Collection.h.jinja2 | 1 + 1 file changed, 1 insertion(+) diff --git a/python/templates/Collection.h.jinja2 b/python/templates/Collection.h.jinja2 index e10352e40..dd28da4ed 100644 --- a/python/templates/Collection.h.jinja2 +++ b/python/templates/Collection.h.jinja2 @@ -74,6 +74,7 @@ public: void print(std::ostream& os=std::cout, bool flush=true) const final; /// operator to allow pointer like calling of members a la LCIO + [[deprecated("Use of operator->() is deprecated. Use . instead.")]] {{ class.bare_type }}Collection* operator->() { return static_cast<{{ class.bare_type }}Collection*>(this); } /// Append a new object to the collection, and return this object. From d1afda4d05aec267da54c7c545aff91ee8111b56 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 29 Jul 2025 21:45:01 +0200 Subject: [PATCH 2/2] Fix the deprecation warning in podio --- tests/unittests/frame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unittests/frame.cpp b/tests/unittests/frame.cpp index dc02d5de7..39517f1f5 100644 --- a/tests/unittests/frame.cpp +++ b/tests/unittests/frame.cpp @@ -398,10 +398,10 @@ TEST_CASE("Frame destructor ASanFail") { auto& hitClusters = hitClusterMap[name]; for (int i = 0; i < 3; ++i) { - auto cluster = hitClusters.first->create(); + auto cluster = hitClusters.first.create(); for (int j = 0; j < 5; ++j) { - auto hit = hitClusters.second->create(); + auto hit = hitClusters.second.create(); cluster.addHits(hit); } }