Fix failing tests for use of non-reserved names
authorJonathan Wakely <jwakely@redhat.com>
Mon, 20 May 2019 14:38:21 +0000 (15:38 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 20 May 2019 14:38:21 +0000 (15:38 +0100)
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.

From-SVN: r271421

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/17_intro/names.cc
libstdc++-v3/testsuite/experimental/names.cc

index c5b8d6016b0d7f403877905e6ec9987fd5c66433..98a676ec5c0595b4461007aaa82f8c705b4df28d 100644 (file)
@@ -1,5 +1,9 @@
 2019-05-20  Jonathan Wakely  <jwakely@redhat.com>
 
+       * testsuite/17_intro/names.cc: Do not check 'ptr' on Solaris.
+       * testsuite/experimental/names.cc: Include <experimental/filesystem>
+       conditionally.
+
        PR c++/90532 Ensure __is_constructible(T[]) is false
        * include/std/type_traits (__do_is_default_constructible_impl)
        (__is_default_constructible_atom, __is_default_constructible_safe):
index 20123a41287823177f0143a7c474e928096633c8..66c639ff3a33e1ff71ee7c892addb470379884ce 100644 (file)
 #undef y
 #endif
 
+#ifdef __sun__
+// See https://gcc.gnu.org/ml/libstdc++/2019-05/msg00175.html
+#undef ptr
+#endif
+
 #include <bits/stdc++.h>
index e97baf3d5bd7b40ef38aaaf828e8f17c4b72dba5..0746ca34e06ff47683e8f4d4989be2b971a3169c 100644 (file)
@@ -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>