Hi

Pretty straightforward except for the aligned_storage one for which I just avoid the check when gnu-versioned-namespace mode is being used.

    libstdc++: [_GLIBCXX_INLINE_VERSION] Fix several tests failures

    Several tests are failing when libstdc++ is configured with:
    --enable-symvers=gnu-versioned-namespace

    Most of them are due to dg-error checks not considering the __8 nested namespace.

    libstdc++-v3/ChangeLog:

            * testsuite/20_util/aligned_storage/value.cc [_GLIBCXX_INLINE_VERSION]:
            Avoid align_msa check.
            * testsuite/20_util/function_objects/bind_back/111327.cc: Adapt dg-error diagnostic
            to __8 stdnested namespace.
            * testsuite/20_util/function_objects/bind_front/111327.cc: Likewise.             * testsuite/30_threads/packaged_task/cons/dangling_ref.cc: Likewise.             * testsuite/30_threads/packaged_task/cons/lwg4154_neg.cc: Likewise.
            * testsuite/std/format/ranges/format_kind_neg.cc: Likewise.

Let me know if you think it worth a backport.

Tested under Linux x86_64 w/o gnu-versioned-namespace mode.

Ok to commit ?

François

diff --git a/libstdc++-v3/testsuite/20_util/aligned_storage/value.cc 
b/libstdc++-v3/testsuite/20_util/aligned_storage/value.cc
index e2c6f7b5b49..6a2c42489e8 100644
--- a/libstdc++-v3/testsuite/20_util/aligned_storage/value.cc
+++ b/libstdc++-v3/testsuite/20_util/aligned_storage/value.cc
@@ -21,14 +21,14 @@
 #include <type_traits>
 #include <testsuite_tr1.h>
 
-struct MSAlignType { } __attribute__((__aligned__));  
+struct MSAlignType { } __attribute__((__aligned__));
 
 void test01()
 {
   using std::aligned_storage;
   using std::alignment_of;
   using namespace __gnu_test;
-  
+
   const std::size_t align_c = alignment_of<char>::value;
   static_assert(sizeof(aligned_storage<4, align_c>::type) >= 4, "");
   static_assert(__alignof__(aligned_storage<4, align_c>::type) == align_c, "");
@@ -55,9 +55,11 @@ void test01()
   static_assert(__alignof__(aligned_storage<11, align_ct>::type) == align_ct,
                "");
 
+#if !_GLIBCXX_INLINE_VERSION
   const std::size_t align_msa = alignment_of<MSAlignType>::value;
   static_assert(sizeof(aligned_storage<5>::type) >= 5, "");
   static_assert(__alignof__(aligned_storage<5>::type) == align_msa, "");
+#endif
 }
 
 // { dg-warning "deprecated" "" { target c++23 } 0 }
diff --git 
a/libstdc++-v3/testsuite/20_util/function_objects/bind_back/111327.cc 
b/libstdc++-v3/testsuite/20_util/function_objects/bind_back/111327.cc
index d634db9dc1d..f8a65127ccf 100644
--- a/libstdc++-v3/testsuite/20_util/function_objects/bind_back/111327.cc
+++ b/libstdc++-v3/testsuite/20_util/function_objects/bind_back/111327.cc
@@ -39,4 +39,4 @@ int main() {
   std::move(std::as_const(g1))();
 }
 
-// { dg-error "no type named 'type' in 'struct std::invoke_result" "" { target 
c++23 } 0 }
+// { dg-error "no type named 'type' in 'struct std::(__8::)?invoke_result" "" 
{ target c++23 } 0 }
diff --git 
a/libstdc++-v3/testsuite/20_util/function_objects/bind_front/111327.cc 
b/libstdc++-v3/testsuite/20_util/function_objects/bind_front/111327.cc
index 5fe0a83baec..896492b3d74 100644
--- a/libstdc++-v3/testsuite/20_util/function_objects/bind_front/111327.cc
+++ b/libstdc++-v3/testsuite/20_util/function_objects/bind_front/111327.cc
@@ -39,4 +39,4 @@ int main() {
   std::move(std::as_const(g1))();
 }
 
-// { dg-error "no type named 'type' in 'struct std::invoke_result" "" { target 
c++23 } 0 }
+// { dg-error "no type named 'type' in 'struct std::(__8::)?invoke_result" "" 
{ target c++23 } 0 }
diff --git 
a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/dangling_ref.cc 
b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/dangling_ref.cc
index 8cc3f78da9f..83c2b85ccff 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/dangling_ref.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/dangling_ref.cc
@@ -9,4 +9,4 @@ std::packaged_task<const int&()> task(f);
 // { dg-error "dangling reference" "" { target { c++14_down } } 0 }
 // { dg-error "reference to temporary" "" { target { c++14_down } } 0 }
 // { dg-error "static assertion failed" "" { target c++17 } 0 }
-// { dg-error "note: .*std::is_invocable_r" "" { target c++17 } 0 }
+// { dg-error "note: .*std::(__8::)?is_invocable_r" "" { target c++17 } 0 }
diff --git 
a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/lwg4154_neg.cc 
b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/lwg4154_neg.cc
index b3413c2d11a..b0b3945739b 100644
--- a/libstdc++-v3/testsuite/30_threads/packaged_task/cons/lwg4154_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/packaged_task/cons/lwg4154_neg.cc
@@ -14,14 +14,14 @@ struct F {
 const F f;
 std::packaged_task<void()> p(f); // { dg-error "here" }
 // { dg-error "static assertion failed" "" { target *-*-* } 0 }
-// { dg-error "note: .*std::is_invocable_r_v<void, " "" { target c++17 } 0 }
+// { dg-error "note: .*std::(__8::)?is_invocable_r_v<void, " "" { target c++17 
} 0 }
 
 // Only callable as rvalue
 struct Frv {
   int* operator()() && { return 0; }
 };
 std::packaged_task<int*()> p2(Frv{}); // { dg-error "here" }
-// { dg-error "note: .*std::is_invocable_r_v<int., " "" { target c++17 } 0 }
+// { dg-error "note: .*std::(__8::)?is_invocable_r_v<int., " "" { target c++17 
} 0 }
 
 // Only callable as non-const lvalue
 struct Fnc {
diff --git a/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc 
b/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc
index bf8619d3d27..872542000f9 100644
--- a/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc
+++ b/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc
@@ -9,5 +9,5 @@ template<auto> struct Tester { };
 
 Tester<std::format_kind<const int(&)[1]>> t; // { dg-error "here" }
 
-// { dg-error "use of 'std::format_kind" "" { target *-*-* } 0 }
+// { dg-error "use of 'std::(__8::)?format_kind" "" { target *-*-* } 0 }
 // { dg-error "primary_template_not_defined" "" { target *-*-* } 0 }

Reply via email to