Commit 881191e8 by Jonathan Wakely Committed by Jonathan Wakely

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
parent 905d2812
2017-01-26 Jonathan Wakely <jwakely@redhat.com> 2017-01-26 Jonathan Wakely <jwakely@redhat.com>
* 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 PR libstdc++/79243
* include/bits/c++config (literals::string_view_literals::__7): Add. * include/bits/c++config (literals::string_view_literals::__7): Add.
Only declare versioned namespaces for the relevant C++ dialects. Only declare versioned namespaces for the relevant C++ dialects.
......
...@@ -19,19 +19,19 @@ ...@@ -19,19 +19,19 @@
// 23.2.2.4 list operations [lib.list.ops] // 23.2.2.4 list operations [lib.list.ops]
#include <testsuite_hooks.h>
#include <list> #include <list>
#include <testsuite_hooks.h>
struct ThrowingComparator struct ThrowingComparator
{ {
unsigned int throw_after = 0; ThrowingComparator(unsigned n) : throw_after(n), count(0) { }
unsigned int count = 0; unsigned int throw_after;
unsigned int count;
bool operator()(int, int) { bool operator()(int, int) {
if (++count >= throw_after) { if (++count >= throw_after) {
throw 666; throw 666;
} }
return true; return false;
} }
}; };
......
// { dg-do compile } // { dg-do compile { target c++11 } }
// Copyright (C) 2017 Free Software Foundation, Inc. // Copyright (C) 2017 Free Software Foundation, Inc.
// //
......
// { dg-do compile } // { dg-do compile { target c++11 } }
// Copyright (C) 2017 Free Software Foundation, Inc. // Copyright (C) 2017 Free Software Foundation, Inc.
// //
......
// { dg-do compile } // { dg-do compile { target c++11 } }
// Copyright (C) 2017 Free Software Foundation, Inc. // Copyright (C) 2017 Free Software Foundation, Inc.
// //
......
...@@ -25,7 +25,7 @@ void ...@@ -25,7 +25,7 @@ void
test01() test01()
{ {
int i[] = { 1, 2, 3, 4 }; int i[] = { 1, 2, 3, 4 };
std::function<bool(int, int)> f = std::less<>{}; std::function<bool(int, int)> f = std::less<int>{};
// If this uses a moved-from std::function we'll get an exception: // If this uses a moved-from std::function we'll get an exception:
std::make_heap(std::begin(i), std::end(i), f); std::make_heap(std::begin(i), std::end(i), f);
std::sort_heap(std::begin(i), std::end(i), f); std::sort_heap(std::begin(i), std::end(i), f);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment