From cc036d7b752e9ff6a9ad7111e697b1bf0dea4dd5 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Wed, 13 May 2026 16:39:06 +0200 Subject: [PATCH] [cling] Disable pointer check for Experimental namespace This also serves as a testbed for turning it off for the entire ROOT namespace. (cherry picked from commit f3c0f48c5c3f54959e729afcf4fb31b640fac181) --- .../cling/lib/Interpreter/NullDerefProtectionTransformer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.cpp b/interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.cpp index 9b340c082b629..247fc5561dcfc 100644 --- a/interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.cpp +++ b/interpreter/cling/lib/Interpreter/NullDerefProtectionTransformer.cpp @@ -229,6 +229,11 @@ class PointerCheckInjector : public RecursiveASTVisitor { static bool hasPtrCheckDisabledInContext(Sema *S, const Decl* D) { if (isa(D)) return false; + if (auto *NS = dyn_cast(D)) { + if (NS->getName() == "Experimental") { + return true; + } + } for (const auto *Ann : D->specific_attrs()) { if (Ann->getAnnotation() == "__cling__ptrcheck(off)") return true;