[PATCH] Partial solution to LWG 523
Jonathan Wakely
jwakely@redhat.com
Wed Nov 30 13:03:00 GMT 2016
On 26/11/16 16:27 -0800, Tim Shen wrote:
>@@ -235,23 +242,86 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> _StrTransT
> _M_transform(_CharT __ch) const
> {
>- return _M_transform_impl(__ch, typename integral_constant<bool,
>- __collate>::type());
>+ _StrTransT __str = _StrTransT(1, __ch);
I know the copy will be elided, but this could be:
_StrTransT __str(1, __ch);
Not a big deal though.
>diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
>index 953aa87..2fb70b7 100644
>--- a/libstdc++-v3/include/bits/shared_ptr_base.h
>+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
>@@ -1000,7 +1000,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> element_type&
> operator*() const noexcept
> {
>- __glibcxx_assert(_M_ptr != nullptr);
>+ __glibcxx_assert(_M_get() != nullptr);
> return *_M_get();
> }
Oops, thanks, but let's fix this separately (I'll do it now) so the
rest of the patch only touches regex stuff.
>diff --git a/libstdc++-v3/testsuite/28_regex/traits/char/icase.cc b/libstdc++-v3/testsuite/28_regex/traits/char/icase.cc
>new file mode 100644
>index 0000000..6b2d9ee
>--- /dev/null
>+++ b/libstdc++-v3/testsuite/28_regex/traits/char/icase.cc
>@@ -0,0 +1,75 @@
>+// { dg_do run }
>+// { dg-do run { target c++11 } }
The first dg-do should be removed.
OK for trunk with those changes, thanks.
More information about the Libstdc++
mailing list