From: Jonathan Wakely Date: Thu, 26 Jan 2017 19:39:53 +0000 (+0000) Subject: Fix libstdc++ testsuite failures in C++98 and C++11 mode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=881191e8658087899c815b59cccef3858e316027;p=gcc.git Fix libstdc++ testsuite failures in C++98 and C++11 mode * testsuite/23_containers/list/operations/78389.cc: Fix for C++11 mode. * testsuite/23_containers/priority_queue/requirements/constructible.cc: Mark as unsupported in C++98 mode. * testsuite/23_containers/queue/requirements/constructible.cc: Likewise. * testsuite/23_containers/stack/requirements/constructible.cc: Likewise. * testsuite/25_algorithms/make_heap/movable.cc: Fix for C++11 mode. From-SVN: r244950 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 1428ffe95c2..ceb15b0a304 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,15 @@ 2017-01-26 Jonathan Wakely + * testsuite/23_containers/list/operations/78389.cc: Fix for C++11 + mode. + * testsuite/23_containers/priority_queue/requirements/constructible.cc: + Mark as unsupported in C++98 mode. + * testsuite/23_containers/queue/requirements/constructible.cc: + Likewise. + * testsuite/23_containers/stack/requirements/constructible.cc: + Likewise. + * testsuite/25_algorithms/make_heap/movable.cc: Fix for C++11 mode. + PR libstdc++/79243 * include/bits/c++config (literals::string_view_literals::__7): Add. Only declare versioned namespaces for the relevant C++ dialects. diff --git a/libstdc++-v3/testsuite/23_containers/list/operations/78389.cc b/libstdc++-v3/testsuite/23_containers/list/operations/78389.cc index 4d8b7d2818b..e0cc6e63c76 100644 --- a/libstdc++-v3/testsuite/23_containers/list/operations/78389.cc +++ b/libstdc++-v3/testsuite/23_containers/list/operations/78389.cc @@ -19,19 +19,19 @@ // 23.2.2.4 list operations [lib.list.ops] -#include - #include +#include struct ThrowingComparator { - unsigned int throw_after = 0; - unsigned int count = 0; + ThrowingComparator(unsigned n) : throw_after(n), count(0) { } + unsigned int throw_after; + unsigned int count; bool operator()(int, int) { if (++count >= throw_after) { throw 666; } - return true; + return false; } }; diff --git a/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/constructible.cc b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/constructible.cc index fa412f33771..b03af48ff3b 100644 --- a/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/constructible.cc +++ b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/constructible.cc @@ -1,4 +1,4 @@ -// { dg-do compile } +// { dg-do compile { target c++11 } } // Copyright (C) 2017 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/23_containers/queue/requirements/constructible.cc b/libstdc++-v3/testsuite/23_containers/queue/requirements/constructible.cc index 99a8b840d96..5f2bf30407a 100644 --- a/libstdc++-v3/testsuite/23_containers/queue/requirements/constructible.cc +++ b/libstdc++-v3/testsuite/23_containers/queue/requirements/constructible.cc @@ -1,4 +1,4 @@ -// { dg-do compile } +// { dg-do compile { target c++11 } } // Copyright (C) 2017 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/23_containers/stack/requirements/constructible.cc b/libstdc++-v3/testsuite/23_containers/stack/requirements/constructible.cc index 0d6e174a796..76785be29e6 100644 --- a/libstdc++-v3/testsuite/23_containers/stack/requirements/constructible.cc +++ b/libstdc++-v3/testsuite/23_containers/stack/requirements/constructible.cc @@ -1,4 +1,4 @@ -// { dg-do compile } +// { dg-do compile { target c++11 } } // Copyright (C) 2017 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/25_algorithms/make_heap/movable.cc b/libstdc++-v3/testsuite/25_algorithms/make_heap/movable.cc index f6738f1d6db..7d34ff248bc 100644 --- a/libstdc++-v3/testsuite/25_algorithms/make_heap/movable.cc +++ b/libstdc++-v3/testsuite/25_algorithms/make_heap/movable.cc @@ -25,7 +25,7 @@ void test01() { int i[] = { 1, 2, 3, 4 }; - std::function f = std::less<>{}; + std::function f = std::less{}; // If this uses a moved-from std::function we'll get an exception: std::make_heap(std::begin(i), std::end(i), f); std::sort_heap(std::begin(i), std::end(i), f);