]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/20_util/function/2.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / function / 2.cc
index 2fd6d3273e1f1351b7bdfcd3acd0c386356dd9d6..2d79ac20ea13aa224c4e632a652e25350ec61522 100644 (file)
@@ -1,7 +1,9 @@
 // { dg-do run { target c++11 } }
+// { dg-require-effective-target hosted }
+
 // 2005-01-15 Douglas Gregor <dgregor@cs.indiana.edu>
 //
-// Copyright (C) 2005-2016 Free Software Foundation, Inc.
+// Copyright (C) 2005-2024 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -25,8 +27,6 @@
 
 using namespace __gnu_test;
 
-bool test __attribute__((unused)) = true;
-
 // Put function pointers into function<> wrappers
 void test02()
 {
@@ -64,7 +64,9 @@ void test02()
 
   // target_type and target() functions
   const function<int(float)>& f1c = f1;
+#if __cpp_rtti
   VERIFY( typeid(int(*)(float)) == f1.target_type() );
+#endif
   VERIFY( f2.target<int(*)(float)>() != 0 );
   VERIFY( *f2.target<int(*)(float)>() == &truncate_float );
   VERIFY( f1c.target<int(*)(float)>() != 0 );