On 26/11/20 22:33 +0000, Jonathan Wakely wrote:
On 26/11/20 15:33 -0500, David Edelsohn via Libstdc++ wrote:
Hi, Jonathan

Thanks for the recent fixes.  I still see a few errors that have crept
in on AIX.  All the same:

FAIL: 17_intro/headers/c++2020/all_no_rtti.cc (test for excess errors)
FAIL: 17_intro/headers/c++2020/all_pedantic_errors.cc (test for excess errors)
FAIL: 17_intro/headers/c++2020/operator_names.cc (test for excess errors)
FAIL: 17_intro/headers/c++2020/stdc++.cc (test for excess errors)
FAIL: 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc (test for
excess errors)

/tmp/GCC/powerpc-ibm-aix7.2.3.0/libstdc++-v3/include/latch:64: error:
'notify_all' is not a member of 'std::__atomic_impl'
/tmp/GCC/powerpc-ibm-aix7.2.3.0/libstdc++-v3/include/latch:75: error:
'__atomic_wait' is not a member of 'std'; did you mean
'__atomic_val_t'?

Can you take a look when you have a moment?

I think that was caused by r11-5436 which added <latch> to the
precompiled header <bits/stdc++.h>, and <latch> incorrectly assumes
that the atomic waiting functions are always available. They're not
available for the gthr-single.h multilib on AIX.

I'm testing the fix now.

And here it is. Committed to trunk.


commit 71988274865bf049c7705ce33350661b75f0af74
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Thu Nov 26 21:54:46 2020

    libstdc++: Only define std::latch if atomic waiting is available
    
    libstdc++-v3/ChangeLog:
    
            * include/std/latch: Depend on _GLIBCXX_HAS_GTHREADS and
            _GLIBCXX_HAVE_LINUX_FUTEX.
            * include/std/version (__cpp_lib_latch): Define conditionally.

diff --git a/libstdc++-v3/include/std/latch b/libstdc++-v3/include/std/latch
index 9d9c880a88bd..3af295b4eb43 100644
--- a/libstdc++-v3/include/std/latch
+++ b/libstdc++-v3/include/std/latch
@@ -27,20 +27,22 @@
  */
 
 #ifndef _GLIBCXX_LATCH
-#define _GLIBCXX_LATCH
+#define _GLIBCXX_LATCH 1
 
 #pragma GCC system_header
 
 #if __cplusplus > 201703L
-#define __cpp_lib_latch 201907L
 
 #include <bits/atomic_base.h>
 #include <ext/numeric_traits.h>
 
+#if defined _GLIBCXX_HAS_GTHREADS || _GLIBCXX_HAVE_LINUX_FUTEX
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+#define __cpp_lib_latch 201907L
+
   class latch
   {
   public:
@@ -87,5 +89,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   };
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
+#endif // GTHREADS || LINUX_FUTEX
 #endif // __cplusplus > 201703L
 #endif // _GLIBCXX_LATCH
diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index cf0454dbaf84..0f2da8a5ddd9 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -216,7 +216,9 @@
 #ifdef _GLIBCXX_HAS_GTHREADS
 # define __cpp_lib_jthread 201911L
 #endif
-#define __cpp_lib_latch 201907L
+#if defined _GLIBCXX_HAS_GTHREADS || defined _GLIBCXX_HAVE_LINUX_FUTEX
+# define __cpp_lib_latch 201907L
+#endif
 #define __cpp_lib_list_remove_return_type 201806L
 #if __cpp_lib_concepts
 # define __cpp_lib_make_obj_using_allocator 201811L
@@ -226,7 +228,7 @@
 #if __cpp_lib_concepts
 # define __cpp_lib_ranges 201911L
 #endif
-#if defined _GLIBCXX_HAS_GTHREADS || _GLIBCXX_HAVE_LINUX_FUTEX
+#if defined _GLIBCXX_HAS_GTHREADS || defined _GLIBCXX_HAVE_LINUX_FUTEX
 # define __cpp_lib_semaphore 201907L
 #endif
 #define __cpp_lib_shift 201806L

Reply via email to