diff --git a/core/foundation/test/testNotFn.cxx b/core/foundation/test/testNotFn.cxx
index 8dc6804f426f255d05fc82d768b5252794671948..c544a5ce72c90f822f2dfe7dd55d18e35fb7361e 100644
--- a/core/foundation/test/testNotFn.cxx
+++ b/core/foundation/test/testNotFn.cxx
@@ -1,7 +1,7 @@
 // Including functional for __cpp_lib_not_fn
 #include <functional>
 
-#ifdef __cpp_lib_not_fn
+#ifndef __cpp_lib_not_fn
 
 #include "ROOT/RNotFn.hxx"