On 20/05/19 14:11 +0000, Szabolcs Nagy wrote:
On 17/05/2019 15:15, Jonathan Wakely wrote:
    * include/bits/random.h (seed_seq::param): Fix non-reserved name.
    * include/experimental/type_traits (is_detected_exact)
    (is_detected_exact_v): Likewise.
    * include/pstl/execution_defs.h (is_execution_policy)
    (is_execution_policy_v, __enable_if_execution_policy): Likewise.
    * include/pstl/execution_impl.h (__policy_traits): Likewise.
    * testsuite/17_intro/names.cc: Check for more non-reserved names.
    * testsuite/experimental/names.cc: New test.

on baremetal (newlib) targets i see

FAIL: experimental/names.cc (test for excess errors)

because

.../gcc/libstdc++-v3/testsuite/experimental/names.cc:25: fatal error: 
experimental/filesystem: No such file or directory

Here's what I've committed ...


commit 73f12f378f1db59395ef88be0ac3291cba9d15c1
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Mon May 20 13:31:11 2019 +0100

    Fix failing tests for use of non-reserved names
    
    Defining 'ptr' fails on Solaris because it's used in <netdb.h>.
    
    Including the Filesystem TS header fails if the TS support wasn't
    enabled by configure.
    
            * testsuite/17_intro/names.cc: Do not check 'ptr' on Solaris.
            * testsuite/experimental/names.cc: Include <experimental/filesystem>
            conditionally.

diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
index 20123a41287..66c639ff3a3 100644
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -187,4 +187,9 @@
 #undef y
 #endif
 
+#ifdef __sun__
+// See https://gcc.gnu.org/ml/libstdc++/2019-05/msg00175.html
+#undef ptr
+#endif
+
 #include <bits/stdc++.h>
diff --git a/libstdc++-v3/testsuite/experimental/names.cc b/libstdc++-v3/testsuite/experimental/names.cc
index e97baf3d5bd..0746ca34e06 100644
--- a/libstdc++-v3/testsuite/experimental/names.cc
+++ b/libstdc++-v3/testsuite/experimental/names.cc
@@ -22,7 +22,9 @@
 
 #include "../17_intro/names.cc"
 // Filesystem
-#include <experimental/filesystem>
+#if __has_include(<experimental/filesystem>)
+# include <experimental/filesystem>
+#endif
 // Library Fundamentals
 #include <experimental/algorithm>
 #include <experimental/any>

Reply via email to