summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-19 15:45:15 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-19 15:45:15 +0000
commit8cf2895d057777c0449529834717540876277657 (patch)
tree767d5dfee63949358a4ffeccf1c91cf91e493b5e /libstdc++-v3
parentf21d4d003ea9d2064d33c74fca8a96d16d987a51 (diff)
downloadgcc-8cf2895d057777c0449529834717540876277657.tar.gz
2013-11-19 Paolo Carlini <paolo.carlini@oracle.com>
* include/experimental/string_view (_S_max_size): Remove. (basic_string_view<>::max_size): Adjust. * testsuite/experimental/string_view/capacity/1.cc: Clean-up. * testsuite/experimental/string_view/inserters/pod/10081-out.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205033 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/experimental/string_view12
-rw-r--r--libstdc++-v3/testsuite/experimental/string_view/capacity/1.cc7
-rw-r--r--libstdc++-v3/testsuite/experimental/string_view/inserters/pod/10081-out.cc7
4 files changed, 12 insertions, 22 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index e59ea54e7c4..946b67f8cfc 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2013-11-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/experimental/string_view (_S_max_size): Remove.
+ (basic_string_view<>::max_size): Adjust.
+ * testsuite/experimental/string_view/capacity/1.cc: Clean-up.
+ * testsuite/experimental/string_view/inserters/pod/10081-out.cc:
+ Likewise.
+
2013-11-19 Jonathan Wakely <jwakely.gcc@gmail.com>
* doc/xml/manual/status_cxx2014.xml: Create new table for TS statuses.
diff --git a/libstdc++-v3/include/experimental/string_view b/libstdc++-v3/include/experimental/string_view
index fbe982ace28..6a95e8d0bd0 100644
--- a/libstdc++-v3/include/experimental/string_view
+++ b/libstdc++-v3/include/experimental/string_view
@@ -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
{
diff --git a/libstdc++-v3/testsuite/experimental/string_view/capacity/1.cc b/libstdc++-v3/testsuite/experimental/string_view/capacity/1.cc
index 8dcff72a2bb..0f09fe89dd6 100644
--- a/libstdc++-v3/testsuite/experimental/string_view/capacity/1.cc
+++ b/libstdc++-v3/testsuite/experimental/string_view/capacity/1.cc
@@ -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()
{
diff --git a/libstdc++-v3/testsuite/experimental/string_view/inserters/pod/10081-out.cc b/libstdc++-v3/testsuite/experimental/string_view/inserters/pod/10081-out.cc
index a275ad216b6..b976d6f441b 100644
--- a/libstdc++-v3/testsuite/experimental/string_view/inserters/pod/10081-out.cc
+++ b/libstdc++-v3/testsuite/experimental/string_view/inserters/pod/10081-out.cc
@@ -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()
{