This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Add header for std::search to testcase
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 Jul 2016 16:43:36 +0100
- Subject: Re: [PATCH] Add header for std::search to testcase
- Authentication-results: sourceware.org; auth=none
- References: <20160714152918.GA22598@redhat.com>
On 14/07/16 16:29 +0100, Jonathan Wakely wrote:
* testsuite/experimental/functional/searchers.cc: Include <algorithm>
for std::search.
This test was failing in Parallel Mode, because it wasn't including
the <algorithm> header for std::search.
Actually that fix isn't quite enough. Even if the testcase didn't use
std::search, the <experimental/functional> header does, and so it
needs more than just <bits/stl_algo.h> when Parallel Mode is active.
Tested x86_64-linux, committed to trunk.
commit 4757fa3aed51ca0e7075c9126c8f9919489bebb4
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Jul 14 16:33:11 2016 +0100
Include header for std::__parallel::search
* include/experimental/functional: Include <parallel/algorithm> in
Parallel Mode.
diff --git a/libstdc++-v3/include/experimental/functional b/libstdc++-v3/include/experimental/functional
index 2095310..ed41f5a 100644
--- a/libstdc++-v3/include/experimental/functional
+++ b/libstdc++-v3/include/experimental/functional
@@ -42,6 +42,9 @@
#include <vector>
#include <array>
#include <bits/stl_algo.h>
+#ifdef _GLIBCXX_PARALLEL
+# include <parallel/algorithm> // For std::__parallel::search
+#endif
namespace std _GLIBCXX_VISIBILITY(default)
{