When running the tests without pre-compiled headers
(--disable-libstdcxx-pch), the test fails, because the feature
testing macro (FTM) isn't defined yet.

This commit moves checking the FMT to after including the header
<functional>.

libstdc++-v3/ChangeLog:

        * testsuite/20_util/function_objects/not_fn/nttp.cc: Move
        test for feature testing macro after #include.

Signed-off-by: Luc Grosheintz <[email protected]>
---
 .../testsuite/20_util/function_objects/not_fn/nttp.cc       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libstdc++-v3/testsuite/20_util/function_objects/not_fn/nttp.cc 
b/libstdc++-v3/testsuite/20_util/function_objects/not_fn/nttp.cc
index d35d828f14c..57d2c6ccf52 100644
--- a/libstdc++-v3/testsuite/20_util/function_objects/not_fn/nttp.cc
+++ b/libstdc++-v3/testsuite/20_util/function_objects/not_fn/nttp.cc
@@ -2,15 +2,15 @@
 
 // { dg-do run { target c++26 } }
 
+#include <functional>
+#include <testsuite_hooks.h>
+
 #ifndef __cpp_lib_not_fn
 # error "Feature test macro for not_fn is missing in <functional>"
 #elif __cpp_lib_not_fn < 202306L
 # error "Feature test macro for not_fn has wrong value in <functional>"
 #endif
 
-#include <functional>
-#include <testsuite_hooks.h>
-
 using std::not_fn;
 
 int func(int, char) { return 0; }
-- 
2.50.1

Reply via email to