string_view testsuite failures on AIX
Paolo Carlini
paolo.carlini@oracle.com
Mon Nov 18 15:47:00 GMT 2013
Hi,
On 11/18/2013 04:03 PM, David Edelsohn wrote:
> experimental/string_view has two testsuite failures on AIX:
>
> FAIL: experimental/string_view/capacity/1.cc (test for excess errors)
> WARNING: experimental/string_view/capacity/1.cc compilation failed to
> produce executable
> FAIL: experimental/string_view/inserters/pod/10081-out.cc (test for
> excess errors)
> WARNING: experimental/string_view/inserters/pod/10081-out.cc
> compilation failed to produce executable
>
> I could not find any discussion after a quick check in libstdc++
> mailing list and bugzilla. Are these known issues?
>
> Details appended below.
I think that the "if !__GXX_WEAK__" things, which, if I remember
correctly were there exactly for AIX, are not needed anymore on modern
systems. Indeed, most of them have been removed looong time ago. Thus
the below should do. What do you think, David? Otherwise we need a
slightly less trivial tweak.
Paolo.
////////////////////
-------------- next part --------------
Index: include/experimental/string_view
===================================================================
--- include/experimental/string_view (revision 204965)
+++ include/experimental/string_view (working copy)
@@ -98,7 +98,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr basic_string_view(const basic_string_view&) noexcept = default;
template<typename _Allocator>
- basic_string_view(const basic_string<_CharT, _Traits, _Allocator>& __str) noexcept
+ basic_string_view(const basic_string<_CharT, _Traits,
+ _Allocator>& __str) noexcept
: _M_len{__str.length()}, _M_str{__str.data()}
{ }
@@ -159,7 +160,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr size_type
max_size() const noexcept
- { return _S_max_size; }
+ { return ((npos - sizeof(size_type) - sizeof(void*))
+ / sizeof(value_type) / 4); }
constexpr bool
empty() const noexcept
@@ -406,12 +408,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
private:
-
- // Compute max_size similarly to how string does it.
- static const size_type _S_max_size = (npos
- - sizeof(size_type) - sizeof(void*))
- / sizeof(value_type) / 4;
-
static constexpr const int
_S_compare(size_type __n1, size_type __n2) noexcept
{
Index: testsuite/experimental/string_view/capacity/1.cc
===================================================================
--- testsuite/experimental/string_view/capacity/1.cc (revision 204965)
+++ testsuite/experimental/string_view/capacity/1.cc (working copy)
@@ -155,13 +155,6 @@ test01()
VERIFY( sz03 >= sz04 );
}
-#if !__GXX_WEAK__
-// Explicitly instantiate for systems with no COMDAT or weak support.
-template
- const std::experimental::basic_string_view<A<B>>::size_type
- std::experimental::basic_string_view<A<B>>::_S_max_size;
-#endif
-
int
main()
{
Index: testsuite/experimental/string_view/inserters/pod/10081-out.cc
===================================================================
--- testsuite/experimental/string_view/inserters/pod/10081-out.cc (revision 204965)
+++ testsuite/experimental/string_view/inserters/pod/10081-out.cc (working copy)
@@ -68,13 +68,6 @@ test01()
}
}
-#if !__GXX_WEAK__
-// Explicitly instantiate for systems with no COMDAT or weak support.
-template
- const std::experimental::basic_string_view<__gnu_test::pod_ushort>::size_type
- std::experimental::basic_string_view_view<__gnu_test::pod_ushort>::_S_max_size;
-#endif
-
int
main()
{
More information about the Libstdc++
mailing list