From e54f0b1930a5dd60f41070a1382292d97dc03dbc Mon Sep 17 00:00:00 2001 From: Attila Krasznahorkay <attila.krasznahorkay@cern.ch> Date: Tue, 11 Jul 2023 16:27:03 +0200 Subject: [PATCH] GCC Clang Pragma Warning Fix, 23.0 branch (2023.07.10.) Only allow Cling to see the warning suppression pragmas. As it turns out, GCC is very touchy about seeing pragmas that are not meant for it. So we need to only expose these pragmas to the ROOT dictionary generation. Even Clang as the main C++ compiler does not need to see them. --- .../AthContainers/AthContainers/tools/threading.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Control/AthContainers/AthContainers/tools/threading.h b/Control/AthContainers/AthContainers/tools/threading.h index 33fea9f6cb26..0952b8b1a629 100644 --- a/Control/AthContainers/AthContainers/tools/threading.h +++ b/Control/AthContainers/AthContainers/tools/threading.h @@ -133,14 +133,14 @@ private: // See ATLINFR-4996 for an explanation of this clunky // warning suppression. -#if __cplusplus > 201703L +#if (__cplusplus > 201703L) && defined(__ROOTCLING__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-volatile" -#endif // >C++17 +#endif // >C++17 with ROOT #include "tbb/concurrent_vector.h" -#if __cplusplus > 201703L +#if (__cplusplus > 201703L) && defined(__ROOTCLING__) #pragma clang diagnostic pop -#endif // >C++17 +#endif // >C++17 with ROOT #include <atomic> #include <mutex> @@ -191,7 +191,7 @@ namespace AthContainers_detail { * lock on the underlying object rather than an exclusive one. */ template <typename LOCKABLE> -class strict_shared_lock +class strict_shared_lock { public: /// The underlying object type. @@ -210,7 +210,7 @@ public: * @param obj The lockable object. */ explicit strict_shared_lock(const lockable_type& obj); - + /** * @brief Release the held lock. -- GitLab