#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, "");
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 }
std::function<const int&()> ff(f); // { dg-error "no matching function" }
std::function<long&&()> f2(f); // { dg-error "no matching function" }
}
-// { dg-error "std::(__8::)?enable_if" "" { target *-*-* } 0 }
+// { dg-error "std::enable_if" "" { target *-*-* } 0 }
c2.find(2); // { dg-error "here" }
}
-// { dg-error "_Compare = std::(__8::)?less<int.>" "" { target *-*-* } 0 }
-// { dg-error "_Compare = std::(__8::)?allocator<int>" "" { target *-*-* } 0 }
+// { dg-error "_Compare = std::less<int.>" "" { target *-*-* } 0 }
+// { dg-error "_Compare = std::allocator<int>" "" { target *-*-* } 0 }
// { dg-error "comparison object must be invocable" "" { target *-*-* } 0 }
// { dg-prune-output "no match for call" }
// { dg-prune-output "invalid conversion" }
c2.find(2); // { dg-error "here" }
}
-// { dg-error "_Compare = std::(__8::)?less<int.>" "" { target *-*-* } 0 }
-// { dg-error "_Compare = std::(__8::)?allocator<int>" "" { target *-*-* } 0 }
+// { dg-error "_Compare = std::less<int.>" "" { target *-*-* } 0 }
+// { dg-error "_Compare = std::allocator<int>" "" { target *-*-* } 0 }
// { dg-error "comparison object must be invocable" "" { target *-*-* } 0 }
// { dg-prune-output "no match for call" }
// { dg-prune-output "invalid conversion" }
set v3_additional_files {}
set comp_output [target_compile $source $dest $type $options]
+
+ # Strip versioned namespace from the compiler output,
+ # so that dg-error and dg-warning patterns can ignore it:
+ regsub -all "std::__8::" $comp_output "std::" comp_output
+
if { $type == "executable" && $file_to_delete != "" } {
file delete $file_to_delete
if { [istarget *-*-darwin*] && [file exists $file_to_delete.dSYM] } {