aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-08-11 16:16:22 +0100
committerJonathan Wakely <jwakely@redhat.com>2020-08-11 16:16:22 +0100
commitfe8d7fec4db838cae536eeef1965db83959cf6ee (patch)
treee7338d03750589fa72769955ea44d6f5a4bf1bda
parent18095be17013444d9e91aa8c73ebe5cf58ccb3f1 (diff)
downloadgcc-fe8d7fec4db838cae536eeef1965db83959cf6ee.zip
gcc-fe8d7fec4db838cae536eeef1965db83959cf6ee.tar.gz
gcc-fe8d7fec4db838cae536eeef1965db83959cf6ee.tar.bz2
libstdc++: Fix failing tests for AIX
These two tests fail on AIX because <sys/thread.h> defines struct thread in the global namespace (despite it not being a reserved name). That means the using-declaration that adds it to the global namespace causes a redeclaration error. libstdc++-v3/ChangeLog: * testsuite/30_threads/thread/cons/84535.cc: Use a custom namespace. * testsuite/30_threads/thread/cons/lwg2097.cc: Likewise.
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/84535.cc3
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/cons/lwg2097.cc3
2 files changed, 6 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/84535.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/84535.cc
index 7846d3f..711687b 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/84535.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/84535.cc
@@ -20,6 +20,8 @@
#include <thread>
+namespace __gnu_test
+{
using std::is_constructible;
using std::thread;
@@ -28,3 +30,4 @@ static_assert(!is_constructible<thread, thread, int>::value, "");
static_assert(!is_constructible<thread, thread&, int>::value, "");
static_assert(!is_constructible<thread, const thread&, int>::value, "");
static_assert(!is_constructible<thread, const thread&&, int>::value, "");
+}
diff --git a/libstdc++-v3/testsuite/30_threads/thread/cons/lwg2097.cc b/libstdc++-v3/testsuite/30_threads/thread/cons/lwg2097.cc
index e0d588e..1ad2a76 100644
--- a/libstdc++-v3/testsuite/30_threads/thread/cons/lwg2097.cc
+++ b/libstdc++-v3/testsuite/30_threads/thread/cons/lwg2097.cc
@@ -20,9 +20,12 @@
#include <thread>
+namespace __gnu_test
+{
using std::thread;
using std::is_constructible;
static_assert( !is_constructible<thread, thread&>::value, "" );
static_assert( !is_constructible<thread, const thread&>::value, "" );
static_assert( !is_constructible<thread, const thread>::value, "" );
+}