// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+// { dg-add-options using-deprecated }
+
// 20.3.6 Binders
#include <vector>
// { dg-options "-Wdeprecated" }
+// { dg-add-options using-deprecated }
// { dg-do compile { target { c++11 && { ! c++20 } } } }
#include <utility>
// { dg-options "-Wno-deprecated" }
+// { dg-add-options using-deprecated }
// { dg-do run { target c++11 } }
// Copyright (C) 2005-2021 Free Software Foundation, Inc.
// { dg-options "-Wno-deprecated" }
+// { dg-add-options using-deprecated }
// { dg-do compile { target c++11 } }
// Copyright (C) 2005-2021 Free Software Foundation, Inc.
// { dg-options "-Wno-deprecated" }
+// { dg-add-options using-deprecated }
// { dg-do compile { target c++11 } }
// Copyright (C) 2008-2021 Free Software Foundation, Inc.
// { dg-options "-Wno-deprecated" }
+// { dg-add-options using-deprecated }
// { dg-do compile { target c++11 } }
// Copyright (C) 2010-2021 Free Software Foundation, Inc.
// { dg-options "-Wno-deprecated" }
+// { dg-add-options using-deprecated }
// { dg-do run { target c++11 } }
// Copyright (C) 2005-2021 Free Software Foundation, Inc.
// { dg-options "-Wno-deprecated" }
+// { dg-add-options using-deprecated }
// { dg-do compile { target c++11 } }
// Copyright (C) 2005-2021 Free Software Foundation, Inc.
// { dg-options "-Wno-deprecated" }
+// { dg-add-options using-deprecated }
// { dg-do run { target c++11 } }
// Copyright (C) 2010-2021 Free Software Foundation, Inc.
// { dg-options "-Wno-deprecated" }
+// { dg-add-options using-deprecated }
// { dg-do run { target c++11 } }
// Copyright (C) 2010-2021 Free Software Foundation, Inc.
struct A { };
-// 20.9.10.2.1 unique_ptr constructors [unique.ptr.single.ctor]
+// 20.9.10.2.1 unique_ptr constructors [unique.ptr.single.ctor]
// Construction from auto_ptr
void
// { dg-options "-Wno-deprecated" }
+// { dg-add-options using-deprecated }
// { dg-do compile { target c++11 } }
// Copyright (C) 2010-2021 Free Software Foundation, Inc.
struct A { };
-// 20.9.10.2.1 unique_ptr constructors [unique.ptr.single.ctor]
+// 20.9.10.2.1 unique_ptr constructors [unique.ptr.single.ctor]
// Construction from const auto_ptr
void
#include <forward_list>
#include <testsuite_hooks.h>
-#include <algorithm>
-
// This test verifies the following:
// remove_if
void
{
std::forward_list<int> fl ={0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
- fl.remove_if(std::bind2nd(std::less<int>(),5));
+ fl.remove_if([](int i) { return i < 5; });
std::forward_list<int>::const_iterator pos = fl.cbegin();
VERIFY(*pos == 5);
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-add-options using-deprecated }
+
/**
* @file priority_queue_erase_if.cpp
* Example showing how to conditionally erase values from a priority queue.
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-add-options using-deprecated }
+
/**
* @file priority_queue_split_join_example.cpp
* A basic example showing how to split and join priority queues.
return $flags
}
+# Add options to enable use of deprecated features.
+proc add_options_for_using-deprecated { flags } {
+ return "$flags -U_GLIBCXX_USE_DEPRECATED -D_GLIBCXX_USE_DEPRECATED=1"
+}
+
# Like dg-options, but adds to the default options rather than replacing them.
proc dg-additional-options { args } {